From cdf3a88d09910084baf17bbddcf2ba612303a3c5 Mon Sep 17 00:00:00 2001 From: NickSdot Date: Fri, 7 Aug 2026 15:15:31 +0000 Subject: [PATCH] ext/standard: applied fixers to improve test robustness --- .../tests/array/GHSA-h96m-rvf9-jgm2.phpt | 4 +- ext/standard/tests/array/array_chunk2.phpt | 8 +- .../tests/array/array_chunk_variation5.phpt | 18 +- ...rray_column_scalar_index_strict_types.phpt | 24 +- .../array_column_scalar_index_weak_types.phpt | 16 +- .../tests/array/array_combine_error2.phpt | 16 +- ext/standard/tests/array/array_diff_1.phpt | 4 +- .../array/array_diff_key_variation1.phpt | 108 ++++----- .../array/array_diff_key_variation2.phpt | 108 ++++----- .../array_diff_leak_custom_type_checks.phpt | 4 +- .../tests/array/array_diff_max_elements.phpt | 4 +- .../tests/array/array_diff_uassoc_error.phpt | 12 +- .../array/array_diff_uassoc_variation1.phpt | 54 ++--- .../array/array_diff_uassoc_variation2.phpt | 54 ++--- .../array/array_diff_ukey_variation1.phpt | 108 ++++----- .../array/array_diff_ukey_variation10.phpt | 8 +- .../array/array_diff_ukey_variation2.phpt | 108 ++++----- .../tests/array/array_fill_error.phpt | 4 +- .../tests/array/array_fill_error2.phpt | 4 +- .../tests/array/array_fill_variation6.phpt | 4 +- .../array/array_filter_invalid_mode.phpt | 2 +- .../tests/array/array_filter_variation10.phpt | 8 +- .../tests/array/array_filter_variation9.phpt | 8 +- .../array_intersect_assoc_variation1.phpt | 100 ++++---- .../array_intersect_assoc_variation2.phpt | 100 ++++---- .../tests/array/array_intersect_empty.phpt | 4 +- .../array/array_intersect_key_variation1.phpt | 108 ++++----- .../array/array_intersect_key_variation2.phpt | 108 ++++----- .../array/array_intersect_side_effects.phpt | 4 +- .../array_intersect_uassoc_variation1.phpt | 108 ++++----- .../array_intersect_uassoc_variation2.phpt | 108 ++++----- .../array_intersect_ukey_variation1.phpt | 108 ++++----- .../array_intersect_ukey_variation2.phpt | 108 ++++----- .../array_intersect_ukey_variation8.phpt | 8 +- .../tests/array/array_intersect_values.phpt | 12 +- .../array/array_intersect_variation1.phpt | 100 ++++---- .../array/array_intersect_variation2.phpt | 100 ++++---- .../tests/array/array_key_exists.phpt | 8 +- .../array/array_key_exists_variation1.phpt | 6 +- .../array/array_key_exists_variation3.phpt | 2 +- ext/standard/tests/array/array_map_error.phpt | 8 +- .../tests/array/array_map_object1.phpt | 12 +- .../tests/array/array_map_object2.phpt | 8 +- .../tests/array/array_map_object3.phpt | 8 +- .../tests/array/array_map_variation10.phpt | 8 +- .../tests/array/array_map_variation12.phpt | 8 +- .../tests/array/array_map_variation14.phpt | 8 +- .../tests/array/array_map_variation15.phpt | 4 +- .../tests/array/array_map_variation16.phpt | 16 +- .../tests/array/array_map_variation17.phpt | 42 ++-- .../tests/array/array_map_variation9.phpt | 4 +- .../array_merge_recursive_variation1.phpt | 100 ++++---- .../array_merge_recursive_variation2.phpt | 50 ++-- .../tests/array/array_merge_variation2.phpt | 50 ++-- .../array/array_pad_too_large_padding.phpt | 6 +- .../tests/array/array_product_variation1.phpt | 1 - .../tests/array/array_product_variation5.phpt | 4 +- .../tests/array/array_push_error2.phpt | 4 +- ext/standard/tests/array/array_rand.phpt | 20 +- .../tests/array/array_rand_variation5.phpt | 16 +- .../tests/array/array_reduce_variation1.phpt | 4 +- .../tests/array/array_search_variation3.phpt | 8 +- .../tests/array/array_slice_variation1.phpt | 8 +- .../tests/array/array_sum_variation8.phpt | 4 +- .../array/array_udiff_assoc_variation1.phpt | 52 ++--- .../array/array_udiff_assoc_variation2.phpt | 52 ++--- .../array/array_udiff_assoc_variation5.phpt | 4 +- .../array/array_udiff_uassoc_variation1.phpt | 52 ++--- .../array/array_udiff_uassoc_variation2.phpt | 52 ++--- .../array/array_udiff_uassoc_variation6.phpt | 4 +- .../tests/array/array_udiff_variation1.phpt | 52 ++--- .../tests/array/array_udiff_variation2.phpt | 52 ++--- .../tests/array/array_udiff_variation5.phpt | 4 +- .../array_uintersect_assoc_variation1.phpt | 52 ++--- .../array_uintersect_assoc_variation2.phpt | 52 ++--- .../array_uintersect_assoc_variation5.phpt | 5 +- .../array_uintersect_uassoc_variation1.phpt | 52 ++--- .../array_uintersect_uassoc_variation2.phpt | 52 ++--- .../array_uintersect_uassoc_variation6.phpt | 4 +- .../array/array_uintersect_variation1.phpt | 52 ++--- .../array/array_uintersect_variation2.phpt | 52 ++--- .../array/array_uintersect_variation5.phpt | 5 +- .../tests/array/array_walk/array_walk.phpt | 4 +- .../array/array_walk/array_walk_error2.phpt | 20 +- .../array/array_walk/array_walk_objects.phpt | 4 +- .../array_walk/array_walk_rec_objects.phpt | 4 +- .../array_walk/array_walk_recursive1.phpt | 4 +- .../array_walk_recursive_error2.phpt | 20 +- .../array_walk_recursive_variation8.phpt | 4 +- .../array_walk/array_walk_variation8.phpt | 4 +- .../tests/array/array_walk/bug30266.phpt | 4 +- .../tests/array/array_walk/bug70713.phpt | 4 +- .../tests/array/array_walk/bug79839.phpt | 4 +- ext/standard/tests/array/bug40191.phpt | 4 +- ext/standard/tests/array/bug42177.phpt | 4 +- ext/standard/tests/array/bug43495.phpt | 4 +- ext/standard/tests/array/bug61058.phpt | 4 +- ext/standard/tests/array/bug65251.phpt | 2 +- ext/standard/tests/array/bug68553.phpt | 8 +- ext/standard/tests/array/bug71220.phpt | 4 +- ext/standard/tests/array/bug74345.phpt | 12 +- ext/standard/tests/array/bug77135.phpt | 6 +- ext/standard/tests/array/bug77931.phpt | 12 +- .../tests/array/compact_variation1.phpt | 8 +- ext/standard/tests/array/count_invalid.phpt | 24 +- .../tests/array/count_invalid_mode.phpt | 6 +- ext/standard/tests/array/extract_error.phpt | 12 +- .../tests/array/extract_error_variation1.phpt | 4 +- .../tests/array/extract_typed_ref.phpt | 4 +- ext/standard/tests/array/gh14775.phpt | 4 +- .../array_splice_uaf_add_elements.phpt | 4 +- .../array_splice_uaf_array_deallocated.phpt | 4 +- ...array_splice_uaf_complex_modification.phpt | 4 +- ...array_splice_uaf_multiple_destructors.phpt | 4 +- .../array_splice_uaf_original_case.phpt | 4 +- .../array_splice_uaf_packed_to_hash.phpt | 4 +- .../array_splice_with_replacement.phpt | 4 +- ext/standard/tests/array/gh19300_2.phpt | 10 +- ext/standard/tests/array/gh20043.phpt | 4 +- ext/standard/tests/array/gh22678.phpt | 2 +- .../array/in_array/in_array_variation3.phpt | 8 +- ext/standard/tests/array/max.phpt | 12 +- ext/standard/tests/array/min.phpt | 12 +- .../tests/array/range/range_bug70239_0.phpt | 4 +- .../tests/array/range/range_bug70239_1.phpt | 4 +- .../tests/array/range/range_bug70239_2.phpt | 4 +- .../tests/array/range/range_bug70239_3.phpt | 4 +- .../range/range_inputs_float_NAN_values.phpt | 32 +-- ...ge_inputs_float_small_step_exhaustion.phpt | 8 +- .../tests/array/range/range_step_errors.phpt | 68 +++--- ext/standard/tests/array/sizeof_object2.phpt | 36 +-- .../array/sort/array_multisort_error.phpt | 8 +- .../sort/array_multisort_variation1.phpt | 52 ++--- .../sort/array_multisort_variation2.phpt | 54 ++--- .../sort/array_multisort_variation3.phpt | 52 ++--- .../tests/array/sort/asort_variation5.phpt | 2 +- ext/standard/tests/array/sort/bug77395.phpt | 4 +- ext/standard/tests/assert/assert_basic6.phpt | 8 +- .../tests/assert/assert_options_error.phpt | 4 +- .../tests/assert/assert_variation.phpt | 4 +- ext/standard/tests/assert/gh22290.phpt | 16 +- ext/standard/tests/assert/gh22291.phpt | 4 +- ext/standard/tests/assert/gh22292.phpt | 8 +- ext/standard/tests/assert/gh22373.phpt | 12 +- ext/standard/tests/assert/gh22387.phpt | 24 +- .../get_class_methods_basic_001.phpt | 4 +- .../get_class_methods_variation_001.phpt | 54 ++--- .../class_object/get_class_variation_001.phpt | 54 ++--- .../get_parent_class_variation_002.phpt | 54 ++--- .../method_exists_variation_001.phpt | 46 ++-- .../class_object/property_exists_error.phpt | 4 +- .../constant_with_typed_class_constant.phpt | 4 +- ext/standard/tests/dir/bug41693.phpt | 4 +- .../tests/dir/closedir_variation2.phpt | 4 +- .../tests/dir/closedir_variation3.phpt | 4 +- .../tests/dir/closedir_without_arg.phpt | 4 +- ext/standard/tests/dir/dir_basic.phpt | 4 +- .../tests/dir/readdir_variation7.phpt | 4 +- .../tests/dir/rewinddir_variation2.phpt | 4 +- .../tests/dir/rewinddir_variation3.phpt | 4 +- .../tests/dir/scandir_invalid_flag.phpt | 4 +- ext/standard/tests/file/006_variation2.phpt | 20 +- ext/standard/tests/file/007_basic.phpt | 104 ++++----- ext/standard/tests/file/bug71882.phpt | 4 +- ext/standard/tests/file/chgrp.phpt | 2 +- .../tests/file/disk_free_space_variation.phpt | 20 +- .../file/disk_total_space_variation.phpt | 10 +- .../tests/file/fclose_variation1.phpt | 4 +- ext/standard/tests/file/feof_basic.phpt | 4 +- ext/standard/tests/file/fgetc_variation2.phpt | 4 +- .../tests/file/fgetcsv_error_conditions.phpt | 24 +- .../tests/file/fgetcsv_variation12.phpt | 146 ++++++------ .../tests/file/fgetcsv_variation19.phpt | 152 ++++++------ ext/standard/tests/file/fgets_error.phpt | 8 +- ext/standard/tests/file/fgets_variation2.phpt | 8 +- ext/standard/tests/file/file_error.phpt | 4 +- .../tests/file/file_get_contents_error.phpt | 4 +- .../file/file_get_contents_error002.phpt | 4 +- ..._get_contents_file_put_contents_error.phpt | 4 +- .../file/file_get_contents_variation8.phpt | 2 +- ...e_get_contents_with_custom_uri_parser.phpt | 4 +- .../tests/file/file_put_contents.phpt | 8 +- .../file/file_put_contents_variation8.phpt | 2 +- ext/standard/tests/file/file_variation6.phpt | 36 +-- .../tests/file/filegroup_variation3.phpt | 2 +- .../tests/file/fileinode_variation3.phpt | 2 +- .../tests/file/fileowner_variation3.phpt | 2 +- .../tests/file/fileperms_variation3.phpt | 2 +- .../tests/file/filesize_variation3.phpt | 4 +- ext/standard/tests/file/flock.phpt | 8 +- ext/standard/tests/file/flock_error.phpt | 22 +- .../tests/file/fnmatch_variation.phpt | 62 ++--- .../tests/file/fputcsv_variation13.phpt | 218 +++++++++--------- .../tests/file/fputcsv_variation17.phpt | 2 +- .../tests/file/fputcsv_variation9.phpt | 218 +++++++++--------- ext/standard/tests/file/fread_error.phpt | 8 +- ext/standard/tests/file/fscanf.phpt | 16 +- ext/standard/tests/file/fscanf_error.phpt | 18 +- .../tests/file/fscanf_variation10.phpt | 6 +- .../tests/file/fscanf_variation11.phpt | 26 +-- .../tests/file/fscanf_variation12.phpt | 38 +-- .../tests/file/fscanf_variation13.phpt | 10 +- .../tests/file/fscanf_variation14.phpt | 50 ++-- .../tests/file/fscanf_variation15.phpt | 32 +-- .../tests/file/fscanf_variation16.phpt | 6 +- .../tests/file/fscanf_variation17.phpt | 26 +-- .../tests/file/fscanf_variation18.phpt | 38 +-- .../tests/file/fscanf_variation19.phpt | 10 +- .../tests/file/fscanf_variation2.phpt | 38 +-- .../tests/file/fscanf_variation20.phpt | 38 +-- .../tests/file/fscanf_variation21.phpt | 32 +-- .../tests/file/fscanf_variation22.phpt | 6 +- .../tests/file/fscanf_variation23.phpt | 26 +-- .../tests/file/fscanf_variation24.phpt | 38 +-- .../tests/file/fscanf_variation25.phpt | 10 +- .../tests/file/fscanf_variation26.phpt | 12 +- .../tests/file/fscanf_variation27.phpt | 38 +-- .../tests/file/fscanf_variation28.phpt | 32 +-- .../tests/file/fscanf_variation29.phpt | 6 +- .../tests/file/fscanf_variation30.phpt | 26 +-- .../tests/file/fscanf_variation31.phpt | 38 +-- .../tests/file/fscanf_variation32.phpt | 10 +- .../tests/file/fscanf_variation35.phpt | 6 +- .../tests/file/fscanf_variation36.phpt | 26 +-- .../tests/file/fscanf_variation37.phpt | 38 +-- .../tests/file/fscanf_variation38.phpt | 10 +- .../tests/file/fscanf_variation4.phpt | 6 +- .../tests/file/fscanf_variation41.phpt | 6 +- .../tests/file/fscanf_variation42.phpt | 26 +-- .../tests/file/fscanf_variation43.phpt | 38 +-- .../tests/file/fscanf_variation44.phpt | 10 +- .../tests/file/fscanf_variation45.phpt | 38 +-- .../tests/file/fscanf_variation46.phpt | 32 +-- .../tests/file/fscanf_variation47.phpt | 6 +- .../tests/file/fscanf_variation48.phpt | 26 +-- .../tests/file/fscanf_variation49.phpt | 38 +-- .../tests/file/fscanf_variation5.phpt | 26 +-- .../tests/file/fscanf_variation50.phpt | 10 +- .../tests/file/fscanf_variation6.phpt | 38 +-- .../tests/file/fscanf_variation7.phpt | 10 +- .../tests/file/fscanf_variation8.phpt | 62 ++--- .../tests/file/fseek_ftell_rewind_error1.phpt | 4 +- .../tests/file/fseek_ftell_rewind_error2.phpt | 4 +- .../tests/file/fseek_ftell_rewind_error3.phpt | 4 +- ext/standard/tests/file/fstat.phpt | 4 +- ext/standard/tests/file/ftruncate.phpt | 4 +- ext/standard/tests/file/ftruncate_error.phpt | 4 +- .../tests/file/ftruncate_variation4.phpt | 98 ++++---- ext/standard/tests/file/fwrite_error.phpt | 4 +- ext/standard/tests/file/gh18212.phpt | 1 - ext/standard/tests/file/glob_variation.phpt | 8 +- .../tests/file/is_dir_variation4.phpt | 2 +- .../tests/file/is_executable_variation1.phpt | 2 +- .../tests/file/is_file_variation4.phpt | 2 +- .../tests/file/is_readable_variation1.phpt | 2 +- .../tests/file/is_writable_variation1.phpt | 4 +- .../tests/file/mkdir_rmdir_variation2.phpt | 8 +- .../tests/file/pathinfo_variation3.phpt | 24 +- .../tests/file/popen_pclose_error.phpt | 12 +- .../proc_open_with_wrong_resource_type.phpt | 4 +- ext/standard/tests/file/readfile_error.phpt | 8 +- .../tests/file/readfile_variation10.phpt | 2 +- .../tests/file/stream_rfc2397_006.phpt | 6 +- .../tests/file/stream_supports_lock.phpt | 4 +- .../symlink_link_linkinfo_is_link_error1.phpt | 4 +- .../tests/file/tempnam_variation3.phpt | 6 +- .../tests/file/tempnam_variation7.phpt | 6 +- .../tests/file/tempnam_variation9.phpt | 2 +- ext/standard/tests/file/touch.phpt | 4 +- ext/standard/tests/file/userstreams.phpt | 4 +- ext/standard/tests/file/userstreams_002.phpt | 12 +- ext/standard/tests/file/userstreams_005.phpt | 4 +- ext/standard/tests/filters/bug54350.phpt | 4 +- ext/standard/tests/filters/bug77231.phpt | 2 +- ext/standard/tests/filters/bug79468.phpt | 4 +- ext/standard/tests/filters/gh20370.phpt | 4 +- .../tests/filters/object_init_failure.phpt | 4 +- .../tests/filters/object_init_failure_2.phpt | 4 +- .../filters/stream_filter_remove_error.phpt | 8 +- ext/standard/tests/general_functions/010.phpt | 4 +- .../tests/general_functions/bug25038.phpt | 8 +- .../tests/general_functions/bug31190.phpt | 9 +- .../tests/general_functions/bug32647.phpt | 32 +-- .../tests/general_functions/bug41037.phpt | 6 +- .../tests/general_functions/bug41970.phpt | 8 +- .../tests/general_functions/bug44295.phpt | 4 +- .../tests/general_functions/bug47857.phpt | 8 +- .../tests/general_functions/bug72920.phpt | 4 +- .../general_functions/callbacks_001.phpt | 4 +- .../general_functions/callbacks_002.phpt | 12 +- .../general_functions/dl_null_bytes.phpt | 4 +- .../general_functions/error_get_last.phpt | 4 +- .../gettype_settype_basic.phpt | 30 +-- .../gettype_settype_error.phpt | 4 +- .../tests/general_functions/gh21058.phpt | 4 +- .../tests/general_functions/gh9905.phpt | 4 +- .../general_functions/ini_set_types.phpt | 4 +- .../is_countable_with_variables.phpt | 4 +- .../general_functions/proc_open_array.phpt | 16 +- .../proc_open_cwd_null_bytes.phpt | 4 +- .../general_functions/proc_open_pipes3.phpt | 4 +- .../general_functions/proc_open_redirect.phpt | 10 +- .../tests/general_functions/putenv.phpt | 8 +- .../putenv_and_getenv_reject_null_bytes.phpt | 12 +- .../register_tick_function_error.phpt | 4 +- .../settype_typed_property.phpt | 4 +- .../sleep_usleep_uint_overflow.phpt | 6 +- .../tests/general_functions/type.phpt | 24 +- .../unregister_tick_function_error.phpt | 4 +- .../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 +- .../tests/http/http_build_query/gh20583.phpt | 2 +- .../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 | 4 +- .../multipart_options_invalid_quantity.phpt | 2 +- .../multipart_options_invalid_value_type.phpt | 2 +- .../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 | 4 +- ext/standard/tests/mail/mail_basic7.phpt | 48 ++-- ext/standard/tests/mail/mail_null_bytes.phpt | 20 +- ext/standard/tests/math/abs_variation.phpt | 18 +- .../tests/math/base_convert_error.phpt | 12 +- .../tests/math/base_convert_overflow.phpt | 2 +- .../tests/math/base_convert_variation1.phpt | 6 +- .../tests/math/bindec_variation1_64bit.phpt | 6 +- ext/standard/tests/math/ceil_variation1.phpt | 18 +- ext/standard/tests/math/clamp.phpt | 24 +- ext/standard/tests/math/decbin_basic.phpt | 4 +- .../tests/math/decbin_basiclong_64bit.phpt | 4 +- .../tests/math/decbin_variation1_64bit.phpt | 10 +- ext/standard/tests/math/dechex_basic.phpt | 4 +- .../tests/math/dechex_basiclong_64bit.phpt | 4 +- .../tests/math/dechex_variation1_64bit.phpt | 10 +- ext/standard/tests/math/decoct_basic.phpt | 4 +- .../tests/math/decoct_basiclong_64bit.phpt | 4 +- .../tests/math/decoct_variation1_64bit.phpt | 10 +- ext/standard/tests/math/floor_variation1.phpt | 18 +- ext/standard/tests/math/gh17384.phpt | 10 +- .../tests/math/hexdec_variation1_64bit.phpt | 6 +- ext/standard/tests/math/intdiv.phpt | 8 +- ext/standard/tests/math/log_error.phpt | 4 +- .../tests/math/octdec_variation1.phpt | 6 +- ext/standard/tests/math/pow_basic_64bit.phpt | 1 - .../tests/math/pow_variation1_64bit.phpt | 12 +- ext/standard/tests/math/pow_variation2.phpt | 12 +- .../tests/math/round_valid_rounding_mode.phpt | 4 +- ext/standard/tests/math/round_variation1.phpt | 18 +- ext/standard/tests/misc/exec_basic1.phpt | 12 +- ext/standard/tests/misc/gh14774.phpt | 14 +- ext/standard/tests/network/bug69523.phpt | 4 +- ext/standard/tests/network/bug69948.phpt | 8 +- ext/standard/tests/network/bug79405.phpt | 8 +- .../dns_check_record_error_conditions.phpt | 8 +- .../dns_get_record_error_conditions.phpt | 12 +- .../tests/network/ghsa-www2-q4fc-65wf.phpt | 36 +-- .../tests/network/openlog_null_bytes.phpt | 4 +- .../network/setcookie_array_option_error.phpt | 28 +-- .../tests/network/setcookie_error.phpt | 18 +- .../tests/network/setrawcookie_error.phpt | 20 +- .../password/password_bcrypt_errors.phpt | 12 +- .../tests/password/password_hash_error.phpt | 20 +- .../password/password_needs_rehash_error.phpt | 16 +- .../tests/password/password_verify_error.phpt | 4 +- ext/standard/tests/poll/gh22759.phpt | 6 +- .../tests/poll/poll_clone_not_allowed.phpt | 8 +- .../tests/poll/poll_ctx_backend_unix.phpt | 4 +- .../tests/poll/poll_double_construct.phpt | 8 +- .../poll/poll_stream_add_error_duplicate.phpt | 4 +- .../poll/poll_watcher_outlives_context.phpt | 8 +- .../tests/serialize/__serialize_002.phpt | 4 +- .../tests/serialize/__serialize_007.phpt | 4 +- ext/standard/tests/serialize/bug64354_1.phpt | 8 +- ext/standard/tests/serialize/bug64354_2.phpt | 4 +- ext/standard/tests/serialize/bug64354_3.phpt | 4 +- ext/standard/tests/serialize/bug73341.phpt | 10 +- ext/standard/tests/serialize/bug81111.phpt | 18 +- ext/standard/tests/serialize/gh15169.phpt | 4 +- .../tests/serialize/incomplete_class.phpt | 4 +- ext/standard/tests/serialize/max_depth.phpt | 8 +- .../serialize/serialization_objects_005.phpt | 20 +- .../serialize/serialization_objects_010.phpt | 4 +- .../splobjectstorage_negative_count.phpt | 4 +- ...typed_property_ref_assignment_failure.phpt | 4 +- .../tests/serialize/typed_property_refs.phpt | 20 +- .../serialize/unserialize_abstract_class.phpt | 4 +- ..._allowed_classes_option_invalid_value.phpt | 12 +- .../non_existing.phpt | 4 +- .../tests/serialize/unserialize_leak.phpt | 4 +- .../tests/setcookie_samesite_validation.phpt | 12 +- ext/standard/tests/streams/bug44712.phpt | 4 +- ext/standard/tests/streams/bug54623.phpt | 4 +- ext/standard/tests/streams/bug61115.phpt | 4 +- ext/standard/tests/streams/bug67626.phpt | 10 +- ext/standard/tests/streams/bug71884.phpt | 4 +- ext/standard/tests/streams/bug74951.phpt | 2 +- ext/standard/tests/streams/bug76857.phpt | 2 +- ext/standard/tests/streams/gh14506.phpt | 8 +- ext/standard/tests/streams/gh14780.phpt | 16 +- ext/standard/tests/streams/gh15908.phpt | 4 +- .../tests/streams/non_finite_values.phpt | 20 +- .../streams/stream_context_create_error.phpt | 12 +- .../stream_context_set_option_error.phpt | 16 +- .../stream_context_set_options_error.phpt | 4 +- .../stream_context_tcp_nodelay_server.phpt | 1 - ...stream_errors_exception_mode_terminal.phpt | 4 +- .../stream_errors_mix_modes_storage.phpt | 4 +- ...ream_errors_set_default_context_error.phpt | 4 +- .../stream_get_contents_negative_length.phpt | 4 +- .../stream_get_meta_data_file_error.phpt | 4 +- .../streams/stream_read_object_return.phpt | 4 +- .../tests/streams/stream_set_chunk_size.phpt | 8 +- .../streams/stream_set_timeout_error.phpt | 4 +- ext/standard/tests/strings/bug33605.phpt | 4 +- ext/standard/tests/strings/bug36944.phpt | 8 +- ext/standard/tests/strings/bug40754.phpt | 40 ++-- ext/standard/tests/strings/bug54322.phpt | 4 +- ext/standard/tests/strings/bug67249.phpt | 4 +- ext/standard/tests/strings/bug69751.phpt | 12 +- ext/standard/tests/strings/bug78833.phpt | 4 +- ext/standard/tests/strings/chr_error.phpt | 8 +- .../tests/strings/chunk_split_variation5.phpt | 12 +- .../tests/strings/chunk_split_variation8.phpt | 12 +- .../tests/strings/count_chars_basic.phpt | 4 +- ext/standard/tests/strings/crypt.phpt | 4 +- ext/standard/tests/strings/dirname_error.phpt | 4 +- ext/standard/tests/strings/dirname_multi.phpt | 4 +- ext/standard/tests/strings/explode.phpt | 16 +- ext/standard/tests/strings/explode1.phpt | 32 +-- ext/standard/tests/strings/fprintf_error.phpt | 12 +- ext/standard/tests/strings/gh11982.phpt | 1 - .../tests/strings/gh18823_strict.phpt | 8 +- ext/standard/tests/strings/gh18823_weak.phpt | 4 +- ext/standard/tests/strings/gh20906_1.phpt | 2 +- ext/standard/tests/strings/implode_error.phpt | 12 +- .../tests/strings/implode_variation.phpt | 14 +- ext/standard/tests/strings/join_error.phpt | 4 +- ext/standard/tests/strings/join_error1.phpt | 48 ++-- .../tests/strings/join_variation1.phpt | 14 +- .../tests/strings/join_variation4.phpt | 4 +- .../tests/strings/join_variation5.phpt | 4 +- .../strings/levenshtein_error_conditions.phpt | 4 +- ext/standard/tests/strings/md5_file.phpt | 4 +- ext/standard/tests/strings/metaphone.phpt | 4 +- .../tests/strings/parse_str_null_bytes.phpt | 4 +- ext/standard/tests/strings/pathinfo.phpt | 32 +-- ext/standard/tests/strings/printf_64bit.phpt | 16 +- ext/standard/tests/strings/printf_error.phpt | 28 +-- .../tests/strings/setlocale_null_byte.phpt | 12 +- ext/standard/tests/strings/sha1_file.phpt | 8 +- ext/standard/tests/strings/sprintf_error.phpt | 36 +-- ext/standard/tests/strings/sprintf_star.phpt | 24 +- .../tests/strings/sprintf_variation1.phpt | 42 ++-- .../strings/sprintf_variation4_64bit.phpt | 1 - .../tests/strings/sprintf_variation52.phpt | 4 +- .../tests/strings/sprintf_variation54.phpt | 4 +- ext/standard/tests/strings/sscanf_error.phpt | 4 +- .../tests/strings/str_decrement_errors.phpt | 30 +-- .../strings/str_decrement_underflow.phpt | 16 +- .../tests/strings/str_increment_errors.phpt | 30 +-- ext/standard/tests/strings/str_pad.phpt | 8 +- .../tests/strings/str_pad_variation1.phpt | 4 +- ext/standard/tests/strings/str_repeat.phpt | 4 +- .../tests/strings/str_replace_basic.phpt | 4 +- .../tests/strings/str_replace_variation3.phpt | 12 +- .../tests/strings/str_split_variation6.phpt | 8 +- .../tests/strings/str_split_variation7.phpt | 8 +- .../tests/strings/str_word_count.phpt | 16 +- .../tests/strings/str_word_count1.phpt | 8 +- .../tests/strings/strip_tags_variation2.phpt | 4 +- ext/standard/tests/strings/stripos_error.phpt | 8 +- .../tests/strings/stristr_variation2.phpt | 10 +- .../tests/strings/strncasecmp_error.phpt | 4 +- ext/standard/tests/strings/strncmp_error.phpt | 4 +- ext/standard/tests/strings/strpbrk_error.phpt | 4 +- ext/standard/tests/strings/strpos.phpt | 16 +- .../tests/strings/strripos_offset.phpt | 20 +- .../strings/strrpos_negative_offset.phpt | 8 +- .../tests/strings/strrpos_offset.phpt | 20 +- .../tests/strings/strrpos_variation7.phpt | 4 +- .../tests/strings/strtr_variation6.phpt | 10 +- .../tests/strings/strtr_variation8.phpt | 30 +-- ext/standard/tests/strings/strval_error.phpt | 4 +- .../tests/strings/substr_compare.phpt | 4 +- .../tests/strings/substr_count_basic.phpt | 8 +- .../tests/strings/substr_count_error.phpt | 16 +- .../tests/strings/substr_replace_error.phpt | 8 +- ext/standard/tests/strings/unpack_error.phpt | 4 +- ext/standard/tests/strings/unpack_offset.phpt | 8 +- .../tests/strings/vfprintf_error1.phpt | 8 +- .../tests/strings/vfprintf_error3.phpt | 12 +- .../tests/strings/vfprintf_error4.phpt | 8 +- .../tests/strings/vfprintf_variation1.phpt | 4 +- .../tests/strings/vprintf_variation2.phpt | 50 ++-- ext/standard/tests/strings/wordwrap.phpt | 4 +- .../tests/strings/wordwrap_error.phpt | 4 +- ext/standard/tests/time/bug60222.phpt | 8 +- .../tests/url/parse_url_error_002.phpt | 4 +- .../version_compare_invalid_operator.phpt | 4 +- 514 files changed, 4210 insertions(+), 4225 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..8f3fb358d492 100644 --- a/ext/standard/tests/array/GHSA-h96m-rvf9-jgm2.phpt +++ b/ext/standard/tests/array/GHSA-h96m-rvf9-jgm2.phpt @@ -8,9 +8,9 @@ $arr = range(0, 2**$power); try { array_merge(...array_fill(0, 2**(32-$power), $arr)); } catch (Error $e) { - echo $e->getMessage(), "\n"; + 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..a12836e741c2 100644 --- a/ext/standard/tests/array/array_chunk2.phpt +++ b/ext/standard/tests/array/array_chunk2.phpt @@ -7,13 +7,13 @@ $input_array = array('a', 'b', 'c', 'd', 'e'); try { var_dump(array_chunk($input_array, 0)); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(array_chunk($input_array, 0, true)); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + 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..94b727de1c88 100644 --- a/ext/standard/tests/array/array_chunk_variation5.phpt +++ b/ext/standard/tests/array/array_chunk_variation5.phpt @@ -24,17 +24,17 @@ foreach ($sizes as $size){ try { var_dump( array_chunk($input_array, $size) ); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( array_chunk($input_array, $size, true) ); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( array_chunk($input_array, $size, false) ); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + 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..99aad1d71473 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 @@ -8,38 +8,38 @@ echo "\n-- Testing array_column() column key parameter should be a string or an try { var_dump(array_column([['php7', 'foo'], ['php8', 'bar']], false)); } catch (\TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(array_column([['php7', 'foo'], ['php8', 'bar']], true)); } catch (\TypeError $e) { - echo $e->getMessage() . "\n"; + 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"; + 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"; + 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"; + 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"; + 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..02a767bd184e 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 @@ -6,38 +6,38 @@ echo "\n-- Testing array_column() column key parameter should be a string or an try { var_dump(array_column([['php7', 'foo'], ['php8', 'bar']], false)); } catch (\TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(array_column([['php7', 'foo'], ['php8', 'bar']], true)); } catch (\TypeError $e) { - echo $e->getMessage() . "\n"; + 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"; + 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"; + 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"; + 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"; + 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..e0371a26060e 100644 --- a/ext/standard/tests/array/array_combine_error2.phpt +++ b/ext/standard/tests/array/array_combine_error2.phpt @@ -13,23 +13,23 @@ echo "\n-- Testing array_combine() function with empty array for \$keys argument try { var_dump( array_combine(array(), array(1, 2)) ); } catch (\ValueError $e) { - echo $e->getMessage(); + 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(); + 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(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -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..aa05c718ceea 100644 --- a/ext/standard/tests/array/array_diff_1.phpt +++ b/ext/standard/tests/array/array_diff_1.phpt @@ -9,11 +9,11 @@ $c = array(5); try { array_diff($a, $b, $c); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..020810250edc 100644 --- a/ext/standard/tests/array/array_diff_key_variation1.phpt +++ b/ext/standard/tests/array/array_diff_key_variation1.phpt @@ -88,12 +88,12 @@ foreach($inputs as $key =>$value) { try { var_dump( array_diff_key($value, $array2) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( array_diff_key($value, $array2, $array3) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..ba5b93e4d7ea 100644 --- a/ext/standard/tests/array/array_diff_key_variation2.phpt +++ b/ext/standard/tests/array/array_diff_key_variation2.phpt @@ -89,12 +89,12 @@ foreach($inputs as $key =>$value) { try { var_dump( array_diff_key($array1, $value) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( array_diff_key($array1, $value, $array3) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..b2cfb5f1270b 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 @@ -6,9 +6,9 @@ array_diff() memory leak with custom type checks try { array_diff([123], 'x'); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..d09755a93cf7 100644 --- a/ext/standard/tests/array/array_diff_max_elements.phpt +++ b/ext/standard/tests/array/array_diff_max_elements.phpt @@ -8,9 +8,9 @@ $arr = range(0, 2**$power); try { array_diff(...array_fill(0, 2**(32-$power), $arr)); } catch (Error $e) { - echo $e->getMessage(), "\n"; + 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..f8fa03bd4dfc 100644 --- a/ext/standard/tests/array/array_diff_uassoc_error.phpt +++ b/ext/standard/tests/array/array_diff_uassoc_error.phpt @@ -24,12 +24,12 @@ echo "\n-- Testing array_diff_uassoc() function with more than expected no. of a try { var_dump( array_diff_uassoc($array1, $array2, "key_compare_func", $extra_arg) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // Testing array_diff_uassoc with one less than the expected number of arguments @@ -37,7 +37,7 @@ echo "\n-- Testing array_diff_uassoc() function with less than expected no. of a try { var_dump( array_diff_uassoc($array1, $array2) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..5a9b22cb2a28 100644 --- a/ext/standard/tests/array/array_diff_uassoc_variation1.phpt +++ b/ext/standard/tests/array/array_diff_uassoc_variation1.phpt @@ -100,7 +100,7 @@ foreach($inputs as $key =>$value) { try { var_dump( array_diff_uassoc($value, $array2, "key_compare_func") ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..b6ac7027c7b7 100644 --- a/ext/standard/tests/array/array_diff_uassoc_variation2.phpt +++ b/ext/standard/tests/array/array_diff_uassoc_variation2.phpt @@ -100,7 +100,7 @@ foreach($inputs as $key =>$value) { try { var_dump( array_diff_uassoc($array1, $value, "key_compare_func") ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..8671348aa427 100644 --- a/ext/standard/tests/array/array_diff_ukey_variation1.phpt +++ b/ext/standard/tests/array/array_diff_ukey_variation1.phpt @@ -96,12 +96,12 @@ foreach($inputs as $key =>$value) { try { var_dump( array_diff_ukey($value, $array2, 'key_compare_func') ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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"; + 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..696bdf4ce24d 100644 --- a/ext/standard/tests/array/array_diff_ukey_variation10.phpt +++ b/ext/standard/tests/array/array_diff_ukey_variation10.phpt @@ -12,18 +12,18 @@ $array2 = array("a" => "green", "yellow", "red"); try { var_dump( array_diff_ukey($array1, $array1, "unknown_function") ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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"; + 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..6be4e8c2f39e 100644 --- a/ext/standard/tests/array/array_diff_ukey_variation2.phpt +++ b/ext/standard/tests/array/array_diff_ukey_variation2.phpt @@ -100,12 +100,12 @@ foreach($inputs as $key =>$value) { try { var_dump( array_diff_ukey($array1, $value, 'key_compare_func') ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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"; + 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..678e545e9a07 100644 --- a/ext/standard/tests/array/array_fill_error.phpt +++ b/ext/standard/tests/array/array_fill_error.phpt @@ -12,10 +12,10 @@ $val = 1; try { var_dump( array_fill($start_key,$num,$val) ); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + 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..18d895140002 100644 --- a/ext/standard/tests/array/array_fill_error2.phpt +++ b/ext/standard/tests/array/array_fill_error2.phpt @@ -10,7 +10,7 @@ $intMax = 2147483647; try { $array = array_fill(0, $intMax+1, 1); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + 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..cf0bc860f0c5 100644 --- a/ext/standard/tests/array/array_fill_variation6.phpt +++ b/ext/standard/tests/array/array_fill_variation6.phpt @@ -10,10 +10,10 @@ var_dump( try { $a[] = "bar"; } catch (Error $ex) { - echo $ex->getMessage(), PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } ?> --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..f39efb581dac 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"; @@ -46,7 +46,7 @@ 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"; + 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..bc936346ea13 100644 --- a/ext/standard/tests/array/array_filter_variation9.phpt +++ b/ext/standard/tests/array/array_filter_variation9.phpt @@ -20,14 +20,14 @@ var_dump( array_filter($input, 'chr') ); try { var_dump( array_filter($input, 'echo') ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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"; + 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..6a90fff127b5 100644 --- a/ext/standard/tests/array/array_intersect_assoc_variation1.phpt +++ b/ext/standard/tests/array/array_intersect_assoc_variation1.phpt @@ -93,14 +93,14 @@ foreach($arrays as $unexpected_value) { try { var_dump( array_intersect_assoc($unexpected_value, $array2) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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"; + 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..98abaef9d1ac 100644 --- a/ext/standard/tests/array/array_intersect_assoc_variation2.phpt +++ b/ext/standard/tests/array/array_intersect_assoc_variation2.phpt @@ -93,14 +93,14 @@ foreach($arrays as $unexpected_value) { try { var_dump( array_intersect_assoc($array1,$unexpected_value) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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"; + 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_empty.phpt b/ext/standard/tests/array/array_intersect_empty.phpt index 1bf527a42694..ab5ae218b7c4 100644 --- a/ext/standard/tests/array/array_intersect_empty.phpt +++ b/ext/standard/tests/array/array_intersect_empty.phpt @@ -36,7 +36,7 @@ var_dump(array_keys($result)); try { array_intersect([], [], new stdClass()); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- @@ -52,4 +52,4 @@ array(1) { [0]=> int(10) } -array_intersect(): Argument #3 must be of type array, stdClass given +TypeError: array_intersect(): Argument #3 must be of type array, stdClass given diff --git a/ext/standard/tests/array/array_intersect_key_variation1.phpt b/ext/standard/tests/array/array_intersect_key_variation1.phpt index ae11e0a2ec93..996481d6aade 100644 --- a/ext/standard/tests/array/array_intersect_key_variation1.phpt +++ b/ext/standard/tests/array/array_intersect_key_variation1.phpt @@ -92,12 +92,12 @@ foreach($inputs as $key =>$value) { try { var_dump( array_intersect_key($value, $array2) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( array_intersect_key($value, $array2, $array3) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..efe9d870ab12 100644 --- a/ext/standard/tests/array/array_intersect_key_variation2.phpt +++ b/ext/standard/tests/array/array_intersect_key_variation2.phpt @@ -93,12 +93,12 @@ foreach($inputs as $key =>$value) { try { var_dump( array_intersect_key($array1, $value) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( array_intersect_key($array1, $value, $array3) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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_side_effects.phpt b/ext/standard/tests/array/array_intersect_side_effects.phpt index 00cacb9b4a39..6c2a2451fdc6 100644 --- a/ext/standard/tests/array/array_intersect_side_effects.phpt +++ b/ext/standard/tests/array/array_intersect_side_effects.phpt @@ -47,7 +47,7 @@ set_error_handler(static function (int $code, string $message): bool { try { array_intersect([[1], [2]], ['Array'], new stdClass()); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } restore_error_handler(); @@ -67,4 +67,4 @@ array(2) { [1]=> string(4) "keep" } -array_intersect(): Argument #3 must be of type array, stdClass given +TypeError: array_intersect(): Argument #3 must be of type array, stdClass 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..0c51c703cbfc 100644 --- a/ext/standard/tests/array/array_intersect_uassoc_variation1.phpt +++ b/ext/standard/tests/array/array_intersect_uassoc_variation1.phpt @@ -100,12 +100,12 @@ foreach($inputs as $key =>$value) { try { var_dump( array_intersect_uassoc($value, $array2, 'key_compare_func') ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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"; + 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..b74dbe4ce783 100644 --- a/ext/standard/tests/array/array_intersect_uassoc_variation2.phpt +++ b/ext/standard/tests/array/array_intersect_uassoc_variation2.phpt @@ -100,12 +100,12 @@ foreach($inputs as $key =>$value) { try { var_dump( array_intersect_uassoc($array1, $value, 'key_compare_func') ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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"; + 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..0ba74cdd9283 100644 --- a/ext/standard/tests/array/array_intersect_ukey_variation1.phpt +++ b/ext/standard/tests/array/array_intersect_ukey_variation1.phpt @@ -98,12 +98,12 @@ foreach($inputs as $key =>$value) { try { var_dump( array_intersect_ukey($value, $array2, 'key_compare_func') ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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"; + 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..c88833960683 100644 --- a/ext/standard/tests/array/array_intersect_ukey_variation2.phpt +++ b/ext/standard/tests/array/array_intersect_ukey_variation2.phpt @@ -98,12 +98,12 @@ foreach($inputs as $key =>$value) { try { var_dump( array_intersect_ukey($array1, $value, 'key_compare_func') ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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"; + 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..6dd1b20ace90 100644 --- a/ext/standard/tests/array/array_intersect_ukey_variation8.phpt +++ b/ext/standard/tests/array/array_intersect_ukey_variation8.phpt @@ -12,18 +12,18 @@ $array2 = array('green' => 5, 'blue' => 6, 'yellow' => 7, 'cyan' => 8); try { var_dump( array_intersect_ukey($array1, $array2, "unknown_function") ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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"; + 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_values.phpt b/ext/standard/tests/array/array_intersect_values.phpt index caac782346b0..53234e103cbb 100644 --- a/ext/standard/tests/array/array_intersect_values.phpt +++ b/ext/standard/tests/array/array_intersect_values.phpt @@ -67,13 +67,13 @@ class ThrowingStringableValue { try { array_intersect(['value'], [new ThrowingStringableValue(), 'value']); } catch (RuntimeException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { array_intersect([''], [new stdClass()]); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } set_error_handler(static function (int $code, string $message): never { @@ -82,7 +82,7 @@ set_error_handler(static function (int $code, string $message): never { try { array_intersect([[1]], [[2]]); } catch (ErrorException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } finally { restore_error_handler(); } @@ -98,6 +98,6 @@ bool(true) bool(true) null,false,true,zero-float,float,resource,object bool(true) -conversion failed -Object of class stdClass could not be converted to string -Array to string conversion +RuntimeException: conversion failed +Error: Object of class stdClass could not be converted to string +ErrorException: Array to string conversion diff --git a/ext/standard/tests/array/array_intersect_variation1.phpt b/ext/standard/tests/array/array_intersect_variation1.phpt index 733250b69f70..9028911590b8 100644 --- a/ext/standard/tests/array/array_intersect_variation1.phpt +++ b/ext/standard/tests/array/array_intersect_variation1.phpt @@ -93,14 +93,14 @@ foreach($arrays as $unexpected_value) { try { var_dump( array_intersect($unexpected_value,$array2) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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"; + 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..1026fb9a7904 100644 --- a/ext/standard/tests/array/array_intersect_variation2.phpt +++ b/ext/standard/tests/array/array_intersect_variation2.phpt @@ -93,14 +93,14 @@ foreach($arrays as $unexpected_value) { try { var_dump( array_intersect($array1,$unexpected_value) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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"; + 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..67123e8495fd 100644 --- a/ext/standard/tests/array/array_key_exists.phpt +++ b/ext/standard/tests/array/array_key_exists.phpt @@ -64,7 +64,7 @@ echo "\n*** Testing error conditions ***\n"; try { array_key_exists(array(), array()); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "\n*** Testing operation on objects ***\n"; @@ -77,7 +77,7 @@ $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"; + 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..44ee64f49638 100644 --- a/ext/standard/tests/array/array_key_exists_variation1.phpt +++ b/ext/standard/tests/array/array_key_exists_variation1.phpt @@ -80,7 +80,7 @@ foreach($inputs as $input) { try { var_dump( array_key_exists($input, $search) ); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + 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..7beb05ed709b 100644 --- a/ext/standard/tests/array/array_key_exists_variation3.phpt +++ b/ext/standard/tests/array/array_key_exists_variation3.phpt @@ -20,7 +20,7 @@ foreach($keys as $key) { try { var_dump(array_key_exists($key, $search)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + 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..0f4cb4685533 100644 --- a/ext/standard/tests/array/array_map_object1.phpt +++ b/ext/standard/tests/array/array_map_object1.phpt @@ -26,7 +26,7 @@ function test($cb, $args) { try { var_dump(array_map($cb, $args)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..8aac77327b6b 100644 --- a/ext/standard/tests/array/array_map_object2.phpt +++ b/ext/standard/tests/array/array_map_object2.phpt @@ -24,14 +24,14 @@ 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"; + 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"; + 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..914ca52d9c1d 100644 --- a/ext/standard/tests/array/array_map_object3.phpt +++ b/ext/standard/tests/array/array_map_object3.phpt @@ -49,7 +49,7 @@ echo "-- accessing child method from parent class --\n"; try { var_dump( array_map(array('ParentClass', 'staticChild'), $arr1) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "-- accessing parent method using child class object --\n"; @@ -59,7 +59,7 @@ 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"; + 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..daf257dfe3b9 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"; @@ -31,7 +31,7 @@ echo "-- passing NULL as 'array1' --\n"; try { var_dump( array_map( function($a) { return array($a); }, NULL)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..c1664364d962 100644 --- a/ext/standard/tests/array/array_map_variation12.phpt +++ b/ext/standard/tests/array/array_map_variation12.phpt @@ -18,14 +18,14 @@ echo "-- with built-in function 'pow' and one parameter --\n"; try { var_dump( array_map('pow', $array1)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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"; + 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..b29a7164bea9 100644 --- a/ext/standard/tests/array/array_map_variation14.phpt +++ b/ext/standard/tests/array/array_map_variation14.phpt @@ -34,14 +34,14 @@ echo "-- with empty string --\n"; try { var_dump( array_map("", $arr1, $arr2) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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"; + 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..0052c57af641 100644 --- a/ext/standard/tests/array/array_map_variation15.phpt +++ b/ext/standard/tests/array/array_map_variation15.phpt @@ -16,12 +16,12 @@ $arr3 = array(1.1, 2.2); try { var_dump( array_map('non_existent', $arr1, $arr2, $arr3) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..e895a87c1253 100644 --- a/ext/standard/tests/array/array_map_variation16.phpt +++ b/ext/standard/tests/array/array_map_variation16.phpt @@ -21,18 +21,18 @@ foreach($callbacks as $callback) try { var_dump( array_map($callback, $arg) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..9ac42d73c647 100644 --- a/ext/standard/tests/array/array_map_variation17.phpt +++ b/ext/standard/tests/array/array_map_variation17.phpt @@ -65,7 +65,7 @@ for($count = 0; $count < count($unexpected_callbacks); $count++) { try { var_dump( array_map($unexpected_callbacks[$count], $arr1)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..9a9442c4e814 100644 --- a/ext/standard/tests/array/array_merge_recursive_variation1.phpt +++ b/ext/standard/tests/array/array_merge_recursive_variation1.phpt @@ -90,7 +90,7 @@ foreach($arrays as $arr1) { try { var_dump( array_merge_recursive($arr1) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // with more arguments @@ -98,7 +98,7 @@ foreach($arrays as $arr1) { try { var_dump( array_merge_recursive($arr1, $arr2) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..c9252b79c54c 100644 --- a/ext/standard/tests/array/array_merge_recursive_variation2.phpt +++ b/ext/standard/tests/array/array_merge_recursive_variation2.phpt @@ -87,7 +87,7 @@ foreach($arrays as $arr2) { try { var_dump( array_merge_recursive($arr1, $arr2) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..7901757f23aa 100644 --- a/ext/standard/tests/array/array_merge_variation2.phpt +++ b/ext/standard/tests/array/array_merge_variation2.phpt @@ -87,7 +87,7 @@ foreach($inputs as $input) { try { var_dump( array_merge($arr1, $input) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..d3b178a6fe91 100644 --- a/ext/standard/tests/array/array_pad_too_large_padding.phpt +++ b/ext/standard/tests/array/array_pad_too_large_padding.phpt @@ -7,7 +7,7 @@ function test($length) { try { var_dump(array_pad(array("", -1, 2.0), $length, 0)); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + 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..a0c237ff1fcb 100644 --- a/ext/standard/tests/array/array_product_variation5.phpt +++ b/ext/standard/tests/array/array_product_variation5.phpt @@ -11,7 +11,7 @@ echo "array_reduce() version:\n"; try { var_dump(array_reduce($input, fn($carry, $value) => $carry * $value, 1)); } catch (TypeError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --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..7ec7ba711086 100644 --- a/ext/standard/tests/array/array_push_error2.phpt +++ b/ext/standard/tests/array/array_push_error2.phpt @@ -13,14 +13,14 @@ $array = array(PHP_INT_MAX => 'max'); try { var_dump(array_push($array, 'new')); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + 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..d9351d070527 100644 --- a/ext/standard/tests/array/array_rand.phpt +++ b/ext/standard/tests/array/array_rand.phpt @@ -6,31 +6,31 @@ array_rand() tests try { var_dump(array_rand(array())); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(array_rand(array(), 0)); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(array_rand(array(1,2,3), 0)); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(array_rand(array(1,2,3), -1)); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(array_rand(array(1,2,3), 10)); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + 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..3b20ee8c3aef 100644 --- a/ext/standard/tests/array/array_rand_variation5.phpt +++ b/ext/standard/tests/array/array_rand_variation5.phpt @@ -29,28 +29,28 @@ 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"; + 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"; + 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"; + 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"; + 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..ca70b29aecec 100644 --- a/ext/standard/tests/array/array_search_variation3.phpt +++ b/ext/standard/tests/array/array_search_variation3.phpt @@ -30,13 +30,13 @@ $array_search_obj = new array_search_check(); //creating new object try { var_dump( array_search("array_var", $array_search_obj) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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"; + 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..59c7caf8e2c1 100644 --- a/ext/standard/tests/array/array_slice_variation1.phpt +++ b/ext/standard/tests/array/array_slice_variation1.phpt @@ -18,12 +18,12 @@ $a = 'foo'; try { var_dump(array_slice(range(1, 3), 0, $a)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(array_slice(range(1, 3), 0, $a)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..c405c22881a8 100644 --- a/ext/standard/tests/array/array_sum_variation8.phpt +++ b/ext/standard/tests/array/array_sum_variation8.phpt @@ -11,7 +11,7 @@ echo "array_reduce() version:\n"; try { var_dump(array_reduce($input, fn($carry, $value) => $carry + $value, 0)); } catch (TypeError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --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..99ad1072d0cc 100644 --- a/ext/standard/tests/array/array_udiff_assoc_variation1.phpt +++ b/ext/standard/tests/array/array_udiff_assoc_variation1.phpt @@ -89,7 +89,7 @@ foreach($inputs as $key =>$value) { try { var_dump( array_udiff_assoc($value, $array2, $key_comp_func) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..22817325ad0b 100644 --- a/ext/standard/tests/array/array_udiff_assoc_variation2.phpt +++ b/ext/standard/tests/array/array_udiff_assoc_variation2.phpt @@ -89,7 +89,7 @@ foreach($inputs as $key =>$value) { try { var_dump( array_udiff_assoc($array1, $value, $key_comp_func) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..3df03b686d48 100644 --- a/ext/standard/tests/array/array_udiff_uassoc_variation1.phpt +++ b/ext/standard/tests/array/array_udiff_uassoc_variation1.phpt @@ -90,7 +90,7 @@ foreach($inputs as $key =>$value) { try { var_dump( array_udiff_uassoc($value, $array2, $data_comp_func, $key_comp_func) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..eae666b02e9f 100644 --- a/ext/standard/tests/array/array_udiff_uassoc_variation2.phpt +++ b/ext/standard/tests/array/array_udiff_uassoc_variation2.phpt @@ -90,7 +90,7 @@ foreach($inputs as $key =>$value) { try { var_dump( array_udiff_uassoc($array1, $value, $data_comp_func, $key_comp_func) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..51083bdd929e 100644 --- a/ext/standard/tests/array/array_udiff_variation1.phpt +++ b/ext/standard/tests/array/array_udiff_variation1.phpt @@ -89,7 +89,7 @@ foreach($inputs as $key =>$value) { try { var_dump( array_udiff($value, $array2, $data_comp_func) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..6a0e78c6ca3b 100644 --- a/ext/standard/tests/array/array_udiff_variation2.phpt +++ b/ext/standard/tests/array/array_udiff_variation2.phpt @@ -89,7 +89,7 @@ foreach($inputs as $key =>$value) { try { var_dump( array_udiff($array1, $value, $data_comp_func) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..33b13323f89a 100644 --- a/ext/standard/tests/array/array_uintersect_assoc_variation1.phpt +++ b/ext/standard/tests/array/array_uintersect_assoc_variation1.phpt @@ -89,7 +89,7 @@ foreach($inputs as $key =>$value) { try { var_dump( array_uintersect_assoc($value, $array2, $data_compare_function) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..a57de7a78d08 100644 --- a/ext/standard/tests/array/array_uintersect_assoc_variation2.phpt +++ b/ext/standard/tests/array/array_uintersect_assoc_variation2.phpt @@ -89,7 +89,7 @@ foreach($inputs as $key =>$value) { try { var_dump( array_uintersect_assoc($array1, $value, $data_compare_function) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..3dc679d1bd13 100644 --- a/ext/standard/tests/array/array_uintersect_uassoc_variation1.phpt +++ b/ext/standard/tests/array/array_uintersect_uassoc_variation1.phpt @@ -90,7 +90,7 @@ foreach($inputs as $key =>$value) { try { var_dump( array_uintersect_uassoc($value, $array2, $data_compare_func, $key_compare_func) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..42d0cadb59d1 100644 --- a/ext/standard/tests/array/array_uintersect_uassoc_variation2.phpt +++ b/ext/standard/tests/array/array_uintersect_uassoc_variation2.phpt @@ -90,7 +90,7 @@ foreach($inputs as $key =>$value) { try { var_dump( array_uintersect_uassoc($array1, $value, $data_compare_func, $key_compare_func) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..841cfdb48b27 100644 --- a/ext/standard/tests/array/array_uintersect_variation1.phpt +++ b/ext/standard/tests/array/array_uintersect_variation1.phpt @@ -89,7 +89,7 @@ foreach($inputs as $key =>$value) { try { var_dump( array_uintersect($value, $array2, $data_compare_function) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..3ee9b95fc39d 100644 --- a/ext/standard/tests/array/array_uintersect_variation2.phpt +++ b/ext/standard/tests/array/array_uintersect_variation2.phpt @@ -89,7 +89,7 @@ foreach($inputs as $key =>$value) { try { var_dump( array_uintersect($array1, $value, $data_compare_function) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..d4383c2b1bee 100644 --- a/ext/standard/tests/array/array_walk/array_walk.phpt +++ b/ext/standard/tests/array/array_walk/array_walk.phpt @@ -19,7 +19,7 @@ function foo2($v1, $v2, $v3) { try { var_dump(array_walk($var,"foo2", "data")); } catch (Exception $e) { - var_dump($e->getMessage()); + 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 44b5b27e51e8..09535005ce2b 100644 --- a/ext/standard/tests/array/array_walk/array_walk_objects.phpt +++ b/ext/standard/tests/array/array_walk/array_walk_objects.phpt @@ -27,7 +27,7 @@ $var = ""; try { array_walk($var, "walk"); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; @@ -43,5 +43,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 91a97437d217..491175f23bf3 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 @@ -27,7 +27,7 @@ $var = ""; try { array_walk_recursive($var, "walk"); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; @@ -43,5 +43,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..f0b23b4be97d 100644 --- a/ext/standard/tests/array/array_walk/array_walk_recursive1.phpt +++ b/ext/standard/tests/array/array_walk/array_walk_recursive1.phpt @@ -19,7 +19,7 @@ function foo2($v1, $v2, $v3) { try { var_dump(array_walk_recursive($var,"foo2", "data")); } catch (Exception $e) { - var_dump($e->getMessage()); + 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..ccd5f63f4e74 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 @@ -23,7 +23,7 @@ echo "-- With 'echo' language construct --\n"; try { var_dump( array_walk_recursive($input, "echo")); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..d3b3a556c149 100644 --- a/ext/standard/tests/array/array_walk/array_walk_variation8.phpt +++ b/ext/standard/tests/array/array_walk/array_walk_variation8.phpt @@ -23,7 +23,7 @@ echo "-- With 'echo' language construct --\n"; try { var_dump( array_walk($input, "echo")); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..dd3f18ac455e 100644 --- a/ext/standard/tests/array/array_walk/bug30266.phpt +++ b/ext/standard/tests/array/array_walk/bug30266.phpt @@ -28,8 +28,8 @@ try } catch(Exception $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..4c11dc644b5c 100644 --- a/ext/standard/tests/array/array_walk/bug70713.phpt +++ b/ext/standard/tests/array/array_walk/bug70713.phpt @@ -23,9 +23,9 @@ $arr = array('string' => new obj); try { array_walk_recursive($arr, 'settype'); } catch (\TypeError $e) { - echo $e->getMessage() . "\n"; + 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 643604cb9b20..d717c311d8d8 100644 --- a/ext/standard/tests/array/array_walk/bug79839.phpt +++ b/ext/standard/tests/array/array_walk/bug79839.phpt @@ -13,13 +13,13 @@ try { $ref = []; // Should throw }); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($test); ?> --EXPECT-- -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..3a7f146b533c 100644 --- a/ext/standard/tests/array/bug40191.phpt +++ b/ext/standard/tests/array/bug40191.phpt @@ -11,11 +11,11 @@ $arrObj->append('foo'); try { $arr = array_unique($arrObj); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..e0671b51d4f4 100644 --- a/ext/standard/tests/array/bug42177.phpt +++ b/ext/standard/tests/array/bug42177.phpt @@ -21,7 +21,7 @@ $a1 = array_merge_recursive( $a1, $a2 ); try { $a1 = array_merge_recursive( $a1, $a2 ); } catch (\Error $e) { - echo $e->getMessage() . " on line " . $e->getLine() . "\n"; + 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..9e2dc106d5f1 100644 --- a/ext/standard/tests/array/bug43495.phpt +++ b/ext/standard/tests/array/bug43495.phpt @@ -12,7 +12,7 @@ $b["key1"]["key2"]["key3"]=&$b; try { array_merge_recursive($a,$b); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + 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..687b0b7e2d39 100644 --- a/ext/standard/tests/array/bug61058.phpt +++ b/ext/standard/tests/array/bug61058.phpt @@ -6,8 +6,8 @@ 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"; + 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..5a22ce8dc302 100644 --- a/ext/standard/tests/array/bug65251.phpt +++ b/ext/standard/tests/array/bug65251.phpt @@ -7,7 +7,7 @@ Bug #65251: array_merge_recursive() recursion detection broken try { array_merge_recursive($GLOBALS, $GLOBALS); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> diff --git a/ext/standard/tests/array/bug68553.phpt b/ext/standard/tests/array/bug68553.phpt index d309171096c9..462285d49cfa 100644 --- a/ext/standard/tests/array/bug68553.phpt +++ b/ext/standard/tests/array/bug68553.phpt @@ -25,12 +25,12 @@ var_dump(array_column($a, null, 'a')); try { var_dump(array_column([['a' => new stdClass]], null, 'a')); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(array_column([['a' => []]], null, 'a')); } catch (Error $e) { - echo $e->getMessage(), "\n"; + 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..ad2df75d830f 100644 --- a/ext/standard/tests/array/bug71220.phpt +++ b/ext/standard/tests/array/bug71220.phpt @@ -6,8 +6,8 @@ ob_start("compact"); try { ob_end_clean(); } catch (\Error $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --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..fb8d8f41074f 100644 --- a/ext/standard/tests/array/bug74345.phpt +++ b/ext/standard/tests/array/bug74345.phpt @@ -16,12 +16,12 @@ array_map($cb, [], []); try { array_map($cb, null); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { array_map($cb, null, null); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } array_filter([], $cb); array_reduce([], $cb); @@ -34,13 +34,13 @@ usort($array, $cb); try { preg_replace_callback('/./', $cb, new stdClass); } catch (Error $e) { - echo $e->getMessage(), "\n"; + 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..abdd0690efc0 100644 --- a/ext/standard/tests/array/bug77931.phpt +++ b/ext/standard/tests/array/bug77931.phpt @@ -6,21 +6,21 @@ Bug #77931: Warning for array_map mentions wrong type try { array_map('trim', array(), 1); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { array_map('trim', array(), array(), true); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { array_map('trim', array(), array(), array(), null); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..6464219bdfaa 100644 --- a/ext/standard/tests/array/compact_variation1.phpt +++ b/ext/standard/tests/array/compact_variation1.phpt @@ -19,13 +19,13 @@ $arr3 = array(&$string); try { var_dump(compact($arr1)); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(compact($arr2)); } catch (Error $e) { - echo $e->getMessage() . "\n"; + 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..83420e5f4eff 100644 --- a/ext/standard/tests/array/count_invalid.phpt +++ b/ext/standard/tests/array/count_invalid.phpt @@ -7,49 +7,49 @@ try { $result = count(null); var_dump($result); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $result = count("string"); var_dump($result); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $result = count(123); var_dump($result); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $result = count(true); var_dump($result); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $result = count(false); var_dump($result); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $result = count((object) []); var_dump($result); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --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..2e71b4676f8d 100644 --- a/ext/standard/tests/array/count_invalid_mode.phpt +++ b/ext/standard/tests/array/count_invalid_mode.phpt @@ -18,7 +18,7 @@ foreach ($modes as $mode) { try { var_dump(count([], $mode)); } catch (\ValueError $error) { - echo $error->getMessage() . \PHP_EOL; + echo $error::class, ': ', $error->getMessage(), PHP_EOL; } } ?> @@ -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..c0f14f0b2af4 100644 --- a/ext/standard/tests/array/extract_error.phpt +++ b/ext/standard/tests/array/extract_error.phpt @@ -12,25 +12,25 @@ $arr = array(1); try { var_dump( extract($arr, -1) ); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( extract($arr, 7 , "wddr") ); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + 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"; + 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..5dbd855f0b02 100644 --- a/ext/standard/tests/array/extract_error_variation1.phpt +++ b/ext/standard/tests/array/extract_error_variation1.phpt @@ -7,8 +7,8 @@ $a = ["1" => "one", "2" => "two", "3" => "three", "4" => "four", "5" => "five"]; try { extract($a, EXTR_PREFIX_ALL, '85bogus'); } catch (\ValueError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --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..450297454d80 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 (TypeError $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..d2ca5aa6de0b 100644 --- a/ext/standard/tests/array/gh14775.phpt +++ b/ext/standard/tests/array/gh14775.phpt @@ -6,7 +6,7 @@ $var = -PHP_INT_MAX - 1; try { range($var,1,$var); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } --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..0cf665405429 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 @@ -15,8 +15,8 @@ try { array_splice($arr, 1, 2); echo "ERROR: Should have thrown exception\n"; } catch (Error $e) { - echo "Exception caught: " . $e->getMessage() . "\n"; + 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..28d0e321b3cb 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 @@ -15,8 +15,8 @@ try { array_splice($arr, 1, 2); echo "ERROR: Should have thrown exception\n"; } catch (Error $e) { - echo "Exception caught: " . $e->getMessage() . "\n"; + 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..74bb0ad50455 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 @@ -18,8 +18,8 @@ try { array_splice($arr, 1, 1, ["replacement"]); echo "ERROR: Should have thrown exception\n"; } catch (Error $e) { - echo "Exception caught: " . $e->getMessage() . "\n"; + 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..dcca8fe9c125 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 @@ -24,10 +24,10 @@ try { array_splice($arr, 1, 2); echo "ERROR: Should have thrown exception\n"; } catch (Error $e) { - echo "Exception caught: " . $e->getMessage() . "\n"; + 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..ececeb34e665 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 @@ -22,9 +22,9 @@ try { array_splice($arr, 1, 2); echo "ERROR: Should have thrown exception\n"; } catch (Error $e) { - echo "Exception caught: " . $e->getMessage() . "\n"; + 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..2590e37260ce 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 @@ -16,8 +16,8 @@ try { array_splice($arr, 1, 2); echo "ERROR: Should have thrown exception\n"; } catch (Error $e) { - echo "Exception caught: " . $e->getMessage() . "\n"; + 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..a9071dfd25fd 100644 --- a/ext/standard/tests/array/gh16649/array_splice_with_replacement.phpt +++ b/ext/standard/tests/array/gh16649/array_splice_with_replacement.phpt @@ -16,8 +16,8 @@ try { array_splice($arr, 1, 1, $replacement); echo "ERROR: Should have thrown exception\n"; } catch (Error $e) { - echo "Exception caught: " . $e->getMessage() . "\n"; + 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..942fc743c8a3 100644 --- a/ext/standard/tests/array/gh19300_2.phpt +++ b/ext/standard/tests/array/gh19300_2.phpt @@ -7,7 +7,7 @@ function error_handle($level, $message, $file = '', $line = 0){ try { array_multisort($a, SORT_ASC); // Trigger multisort abort } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..f0010a297e50 100644 --- a/ext/standard/tests/array/gh20043.phpt +++ b/ext/standard/tests/array/gh20043.phpt @@ -5,8 +5,8 @@ GH-20043 (array_unique assertion failure with RC1 array causing an exception on try { array_unique([new stdClass, new stdClass], SORT_STRING | SORT_FLAG_CASE); } catch (Error $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --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/gh22678.phpt b/ext/standard/tests/array/gh22678.phpt index c1b71b592520..b09ef21d737c 100644 --- a/ext/standard/tests/array/gh22678.phpt +++ b/ext/standard/tests/array/gh22678.phpt @@ -39,7 +39,7 @@ $c = [new Boom(), new Boom()]; try { array_multisort($c, SORT_STRING); } catch (Exception $e) { - echo $e::class, ": ", $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- 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..6b98d8ea0573 100644 --- a/ext/standard/tests/array/in_array/in_array_variation3.phpt +++ b/ext/standard/tests/array/in_array/in_array_variation3.phpt @@ -32,13 +32,13 @@ $in_array_obj = new in_array_check(); //creating new object try { var_dump( in_array("array_var", $in_array_obj) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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"; + 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..bfca2ddc16f4 100644 --- a/ext/standard/tests/array/max.phpt +++ b/ext/standard/tests/array/max.phpt @@ -8,19 +8,19 @@ precision=14 try { var_dump(max(1)); } catch (\TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(max(array())); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(max(new stdclass)); } catch (\TypeError $e) { - echo $e->getMessage() . "\n"; + 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..47f4b4aac83d 100644 --- a/ext/standard/tests/array/min.phpt +++ b/ext/standard/tests/array/min.phpt @@ -8,19 +8,19 @@ precision=14 try { var_dump(min(1)); } catch (\TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(min(array())); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(min(new stdclass)); } catch (\TypeError $e) { - echo $e->getMessage() . "\n"; + 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..9df7e5114abd 100644 --- a/ext/standard/tests/array/range/range_bug70239_0.phpt +++ b/ext/standard/tests/array/range/range_bug70239_0.phpt @@ -5,8 +5,8 @@ Bug #70239 Creating a huge array doesn't result in exhausted, but segfault, var try { range(0, pow(2.0, 100000000)); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + 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..6553a88eca09 100644 --- a/ext/standard/tests/array/range/range_bug70239_1.phpt +++ b/ext/standard/tests/array/range/range_bug70239_1.phpt @@ -5,8 +5,8 @@ Bug #70239 Creating a huge array doesn't result in exhausted, but segfault, var try { range(pow(2.0, 100000000), pow(2.0, 100000000) + 1); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + 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..b0f4d13da7fa 100644 --- a/ext/standard/tests/array/range/range_bug70239_2.phpt +++ b/ext/standard/tests/array/range/range_bug70239_2.phpt @@ -5,8 +5,8 @@ Bug #70239 Creating a huge array doesn't result in exhausted, but segfault, var try { var_dump(range(0, PHP_INT_MAX)); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + 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..a9958f50b461 100644 --- a/ext/standard/tests/array/range/range_bug70239_3.phpt +++ b/ext/standard/tests/array/range/range_bug70239_3.phpt @@ -5,8 +5,8 @@ Bug #70239 Creating a huge array doesn't result in exhausted, but segfault, var try { var_dump(range(PHP_INT_MIN, 0)); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + 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..08518c51529b 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 @@ -29,7 +29,7 @@ foreach ($fs as $s) { try { var_dump( range($s, $e) ); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } } @@ -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..f81873df051d 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 @@ -5,14 +5,14 @@ Creating a range that exceeds the maximum array size try { var_dump(range(0, 100_000_000_000, 0.1)); } catch (\ValueError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(range(PHP_INT_MIN, PHP_INT_MAX, 1)); } catch (\ValueError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --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..2dcc48353fb0 100644 --- a/ext/standard/tests/array/range/range_step_errors.phpt +++ b/ext/standard/tests/array/range/range_step_errors.phpt @@ -8,54 +8,54 @@ echo "Step cannot be 0\n"; try { var_dump( range(1.0, 7.0, 0.0) ); } catch (\ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( range(1, 7, 0) ); } catch (\ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( range('A', 'H', 0) ); } catch (\ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( range('A', 'H', 0.0) ); } catch (\ValueError $e) { - echo $e->getMessage(), "\n"; + 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"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( range(1, 7, 10.0**400) ); } catch (\ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( range('A', 'H', 10.0**400) ); } catch (\ValueError $e) { - echo $e->getMessage(), "\n"; + 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"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( range(1, 7, fdiv(0, 0)) ); } catch (\ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( range('A', 'H', fdiv(0, 0)) ); } catch (\ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Step must be within the range of input parameters\n"; @@ -63,72 +63,72 @@ 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"; + 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"; + 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"; + 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"; + 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"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(range(1, 3, -1)); } catch (\ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(range(1.5, 3.5, -1.5)); } catch (\ValueError $e) { - echo $e->getMessage(), "\n"; + 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..363a253bf9c4 100644 --- a/ext/standard/tests/array/sizeof_object2.phpt +++ b/ext/standard/tests/array/sizeof_object2.phpt @@ -77,21 +77,21 @@ for($i = 0; $i < count($objects); $i++) try { var_dump( sizeof($var) ); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "COUNT_NORMAL Mode: "; try { var_dump( sizeof($var, COUNT_NORMAL) ); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "COUNT_RECURSIVE Mode: "; try { var_dump( sizeof($var, COUNT_RECURSIVE) ); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $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..33a7060e48c1 100644 --- a/ext/standard/tests/array/sort/array_multisort_error.phpt +++ b/ext/standard/tests/array/sort/array_multisort_error.phpt @@ -9,7 +9,7 @@ $ar1 = array(1); try { var_dump( array_multisort($ar1, SORT_ASC, SORT_ASC) ); } catch (\TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Testing array_multisort() function with repeated flags --\n"; @@ -17,7 +17,7 @@ $ar1 = array(1); try { var_dump( array_multisort($ar1, SORT_STRING, SORT_NUMERIC) ); } catch (\TypeError $e) { - echo $e->getMessage() . "\n"; + 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..e47127a071c4 100644 --- a/ext/standard/tests/array/sort/array_multisort_variation1.phpt +++ b/ext/standard/tests/array/sort/array_multisort_variation1.phpt @@ -94,7 +94,7 @@ foreach($inputs as $key =>$value) { try { var_dump( array_multisort($value)); } catch (\ValueError | \TypeError $e) { - echo $e->getMessage() . "\n"; + 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..fe4a9bcbba5f 100644 --- a/ext/standard/tests/array/sort/array_multisort_variation2.phpt +++ b/ext/standard/tests/array/sort/array_multisort_variation2.phpt @@ -102,7 +102,7 @@ foreach($inputs as $key =>$value) { try { var_dump( array_multisort($ar1, $value) ); } catch (\ValueError | \TypeError $e) { - echo $e->getMessage() . "\n"; + 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..b06d445dfe8b 100644 --- a/ext/standard/tests/array/sort/array_multisort_variation3.phpt +++ b/ext/standard/tests/array/sort/array_multisort_variation3.phpt @@ -94,7 +94,7 @@ foreach($inputs as $key =>$value) { try { var_dump( array_multisort($ar1, SORT_REGULAR, $value) ); } catch (\ValueError | \TypeError $e) { - echo $e->getMessage() . "\n"; + 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..800af618d32e 100644 --- a/ext/standard/tests/array/sort/bug77395.phpt +++ b/ext/standard/tests/array/sort/bug77395.phpt @@ -14,8 +14,8 @@ $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"; + 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..417388c15139 100644 --- a/ext/standard/tests/assert/assert_basic6.phpt +++ b/ext/standard/tests/assert/assert_basic6.phpt @@ -16,7 +16,7 @@ var_dump(assert_options(ASSERT_CALLBACK)); try { assert(false); } catch (AssertionError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "\n"; @@ -27,7 +27,7 @@ var_dump(assert_options(ASSERT_CALLBACK)); try { assert(false); } catch (AssertionError $exception) { - echo $exception->getMessage() . "\n"; + 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..7d3f2469f925 100644 --- a/ext/standard/tests/assert/assert_options_error.phpt +++ b/ext/standard/tests/assert/assert_options_error.phpt @@ -6,9 +6,9 @@ assert_options() - unknown assert option. try { assert_options(1000); } catch (\ValueError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --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..1e5c92e25a85 100644 --- a/ext/standard/tests/assert/assert_variation.phpt +++ b/ext/standard/tests/assert/assert_variation.phpt @@ -54,7 +54,7 @@ echo "ini.get(\"assert.callback\") => [".ini_get("assert.callback")."]\n"; try { var_dump($r2=assert(0 != 0)); } catch (Error $e) { - echo $e->getMessage(), "\n"; + 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..4759f89dd21a 100644 --- a/ext/standard/tests/assert/gh22290.phpt +++ b/ext/standard/tests/assert/gh22290.phpt @@ -10,30 +10,30 @@ try { $string = "Foo\x00bar"; assert(!str_contains($string, "\x00")); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert(["a\x00b" => 1] === []); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert("tab\there" === ""); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert(str_contains("plain", "zzz")); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --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..b1883c6488ab 100644 --- a/ext/standard/tests/assert/gh22291.phpt +++ b/ext/standard/tests/assert/gh22291.phpt @@ -9,11 +9,11 @@ try { var_dump("{$foo}"); assert(!"{{$foo}}"); } catch (Error $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --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..44555d19b8a0 100644 --- a/ext/standard/tests/assert/gh22292.phpt +++ b/ext/standard/tests/assert/gh22292.phpt @@ -12,7 +12,7 @@ try { var_dump(${'---'}); assert(!${'---'}); } catch (Error $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { @@ -20,12 +20,12 @@ try { var_dump($f->{'---'}); assert(!$f->{'---'}); } catch (Error $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --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..4c35de7a6b9f 100644 --- a/ext/standard/tests/assert/gh22373.phpt +++ b/ext/standard/tests/assert/gh22373.phpt @@ -12,17 +12,17 @@ class Foo { try { assert(($this->f)('abc') !== 'cba'); } catch (Error $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert(($this?->f)('abc') !== 'cba'); } catch (Error $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert((self::$sf)('abc') !== 'cba'); } catch (Error $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } } @@ -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..abd0938a4b40 100644 --- a/ext/standard/tests/assert/gh22387.phpt +++ b/ext/standard/tests/assert/gh22387.phpt @@ -19,44 +19,44 @@ const baz = new stdClass(); try { assert(!$foo instanceof (bar)); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert(!new (bar)()); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert(!(bar)::m()); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert(!(bar)::$p); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert(!(bar)::C); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert((baz)::class !== 'stdClass'); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --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 bee28f54422d..b7a52bb65249 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 @@ -28,7 +28,7 @@ echo "Argument is non existent class:\n"; try { var_dump( get_class_methods("NonExistent") ); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + 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, string given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, string given Done diff --git a/ext/standard/tests/class_object/get_class_methods_variation_001.phpt b/ext/standard/tests/class_object/get_class_methods_variation_001.phpt index f7b86a2977ac..0026212f0878 100644 --- a/ext/standard/tests/class_object/get_class_methods_variation_001.phpt +++ b/ext/standard/tests/class_object/get_class_methods_variation_001.phpt @@ -73,7 +73,7 @@ foreach($values as $value) { try { var_dump( get_class_methods($value) ); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } echo "Done"; @@ -84,89 +84,89 @@ Error: 2 - Undefined variable $undefined_var Error: 2 - Undefined variable $unset_var Arg value 0 -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, int given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, int given Arg value 1 -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, int given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, int given Arg value 12345 -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, int given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, int given Arg value -2345 -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, int given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, int given Arg value 10.5 -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, float given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, float given Arg value -10.5 -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, float given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, float given Arg value 101234567000 -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, float given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, float given Arg value 1.07654321E-9 -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, float given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, float given Arg value 0.5 -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, float given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, float given Error: 2 - Array to string conversion Arg value Array -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, array given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, array given Error: 2 - Array to string conversion Arg value Array -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, array given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, array given Error: 2 - Array to string conversion Arg value Array -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, array given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, array given Error: 2 - Array to string conversion Arg value Array -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, array given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, array given Error: 2 - Array to string conversion Arg value Array -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, array given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, array given Arg value -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, null given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, null given Arg value -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, null given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, null given Arg value 1 -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, true given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, true given Arg value -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, false given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, false given Arg value 1 -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, true given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, true given Arg value -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, false given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, false given Arg value -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, string given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, string given Arg value -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, string given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, string given Arg value string -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, string given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, string given Arg value string -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, string given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, string given Arg value stdClass array(0) { } Arg value -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, null given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, null given Arg value -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, null given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, null 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..2c2854259802 100644 --- a/ext/standard/tests/class_object/get_class_variation_001.phpt +++ b/ext/standard/tests/class_object/get_class_variation_001.phpt @@ -65,7 +65,7 @@ foreach($values as $value) { try { var_dump( get_class($value) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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/get_parent_class_variation_002.phpt b/ext/standard/tests/class_object/get_parent_class_variation_002.phpt index 8faeff9dd8dc..bcfe4581f72c 100644 --- a/ext/standard/tests/class_object/get_parent_class_variation_002.phpt +++ b/ext/standard/tests/class_object/get_parent_class_variation_002.phpt @@ -75,7 +75,7 @@ foreach ($values as $value) { try { var_dump(get_parent_class($value)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } @@ -87,90 +87,90 @@ Error: 2 - Undefined variable $undefined_var Error: 2 - Undefined variable $unset_var Arg value 0 -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, int given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, int given Arg value 1 -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, int given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, int given Arg value 12345 -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, int given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, int given Arg value -2345 -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, int given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, int given Arg value 10.5 -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, float given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, float given Arg value -10.5 -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, float given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, float given Arg value 101234567000 -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, float given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, float given Arg value 1.07654321E-9 -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, float given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, float given Arg value 0.5 -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, float given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, float given Error: 2 - Array to string conversion Arg value Array -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, array given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, array given Error: 2 - Array to string conversion Arg value Array -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, array given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, array given Error: 2 - Array to string conversion Arg value Array -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, array given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, array given Error: 2 - Array to string conversion Arg value Array -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, array given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, array given Error: 2 - Array to string conversion Arg value Array -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, array given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, array given Arg value -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, null given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, null given Arg value -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, null given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, null given Arg value 1 -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, true given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, true given Arg value -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, false given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, false given Arg value 1 -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, true given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, true given Arg value -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, false given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, false given Arg value -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, string given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, string given Arg value -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, string given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, string given Arg value string In autoload(string) -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, string given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, string given Arg value String In autoload(String) -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, string given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, string given Arg value stdClass bool(false) Arg value -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, null given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, null given Arg value -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, null given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, 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..ab445e8f73a8 100644 --- a/ext/standard/tests/class_object/method_exists_variation_001.phpt +++ b/ext/standard/tests/class_object/method_exists_variation_001.phpt @@ -75,7 +75,7 @@ foreach($values as $value) { try { var_dump( method_exists($value, $method) ); } catch (TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } }; @@ -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..fd8c5cde0e6a 100644 --- a/ext/standard/tests/class_object/property_exists_error.phpt +++ b/ext/standard/tests/class_object/property_exists_error.phpt @@ -10,7 +10,7 @@ $property_name = 'string_val'; try { var_dump( property_exists(10, $property_name) ); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -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..298488c0fd33 100644 --- a/ext/standard/tests/constant_with_typed_class_constant.phpt +++ b/ext/standard/tests/constant_with_typed_class_constant.phpt @@ -15,11 +15,11 @@ var_dump(constant("FOO::CONST1")); try { constant("FOO::CONST2"); } catch (TypeError $e) { - echo $e->getMessage() . "\n"; + 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..931d1a76a063 100644 --- a/ext/standard/tests/dir/bug41693.phpt +++ b/ext/standard/tests/dir/bug41693.phpt @@ -6,9 +6,9 @@ Bug #41693 (scandir() allows empty directory names) try { var_dump(scandir('')); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + 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..88d71d45cf9f 100644 --- a/ext/standard/tests/dir/closedir_variation2.phpt +++ b/ext/standard/tests/dir/closedir_variation2.phpt @@ -23,7 +23,7 @@ echo "\n-- Close directory handle second time: --\n"; try { var_dump(closedir($dh)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..70987a7007d2 100644 --- a/ext/standard/tests/dir/closedir_variation3.phpt +++ b/ext/standard/tests/dir/closedir_variation3.phpt @@ -15,7 +15,7 @@ echo "\n-- Try to close the file pointer using closedir() --\n"; try { var_dump(closedir($fp)); } catch (\TypeError $e) { - echo $e->getMessage() . "\n"; + 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..e3d39d714912 100644 --- a/ext/standard/tests/dir/closedir_without_arg.phpt +++ b/ext/standard/tests/dir/closedir_without_arg.phpt @@ -5,9 +5,9 @@ Calling closedir() without argument and without opening a directory beforehand try { closedir(); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..5d9b7c0f81c1 100644 --- a/ext/standard/tests/dir/dir_basic.phpt +++ b/ext/standard/tests/dir/dir_basic.phpt @@ -36,7 +36,7 @@ echo "\nTest read after closing the dir:\n"; try { var_dump( $d->read() ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..5e299366fc2e 100644 --- a/ext/standard/tests/dir/readdir_variation7.phpt +++ b/ext/standard/tests/dir/readdir_variation7.phpt @@ -13,11 +13,11 @@ var_dump($fp = fopen(__FILE__, "r")); try { var_dump( readdir($fp) ); } catch (\TypeError $e) { - echo $e->getMessage() . "\n"; + 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..6779c563c1ac 100644 --- a/ext/standard/tests/dir/rewinddir_variation2.phpt +++ b/ext/standard/tests/dir/rewinddir_variation2.phpt @@ -20,7 +20,7 @@ echo "\n-- Call to rewinddir() --\n"; try { var_dump(rewinddir($dir_handle)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..79b1c9a562c4 100644 --- a/ext/standard/tests/dir/rewinddir_variation3.phpt +++ b/ext/standard/tests/dir/rewinddir_variation3.phpt @@ -16,7 +16,7 @@ $result1 = fread($fp, 5); try { var_dump(rewinddir($fp)); } catch (\TypeError $e) { - echo $e->getMessage() . "\n"; + 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..3cb6f142bea5 100644 --- a/ext/standard/tests/dir/scandir_invalid_flag.phpt +++ b/ext/standard/tests/dir/scandir_invalid_flag.phpt @@ -5,8 +5,8 @@ Provide wrong flags to scandir() try { scandir('something', -1); } catch (ValueError $e) { - echo $e->getMessage() . "\n"; + 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..7f07918d00dd 100644 --- a/ext/standard/tests/file/006_variation2.phpt +++ b/ext/standard/tests/file/006_variation2.phpt @@ -55,7 +55,7 @@ foreach($perms_array as $permission) { echo "\n"; clearstatcache(); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { @@ -64,7 +64,7 @@ foreach($perms_array as $permission) { echo "\n"; clearstatcache(); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..12a9cd7ff258 100644 --- a/ext/standard/tests/file/007_basic.phpt +++ b/ext/standard/tests/file/007_basic.phpt @@ -43,12 +43,12 @@ for( $i=0; $igetMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( feof($handle) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -78,12 +78,12 @@ for( $i=0; $igetMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( feof($handle) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..594d1eda4d86 100644 --- a/ext/standard/tests/file/bug71882.phpt +++ b/ext/standard/tests/file/bug71882.phpt @@ -6,8 +6,8 @@ $fd = fopen("php://memory", "w+"); try { var_dump(ftruncate($fd, -1)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --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..94ce4ecb1594 100644 --- a/ext/standard/tests/file/chgrp.phpt +++ b/ext/standard/tests/file/chgrp.phpt @@ -10,7 +10,7 @@ if(substr(PHP_OS, 0, 3) == "WIN") try { chgrp("sjhgfskhagkfdgskjfhgskfsdgfkdsajf", 0); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + 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..c4edf529e30a 100644 --- a/ext/standard/tests/file/disk_free_space_variation.phpt +++ b/ext/standard/tests/file/disk_free_space_variation.phpt @@ -44,12 +44,12 @@ foreach($dirs_arr as $dir1) { try { var_dump( disk_free_space( $dir1 ) ); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( diskfreespace( $dir1 ) ); } catch (Error $e) { - echo $e->getMessage(), "\n"; + 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..899b5b9abd52 100644 --- a/ext/standard/tests/file/disk_total_space_variation.phpt +++ b/ext/standard/tests/file/disk_total_space_variation.phpt @@ -47,7 +47,7 @@ foreach($dirs_arr as $dir1) { try { var_dump( disk_total_space( $dir1 ) ); } catch (Error $e) { - echo $e->getMessage(), "\n"; + 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..8ddb1f48c42d 100644 --- a/ext/standard/tests/file/fclose_variation1.phpt +++ b/ext/standard/tests/file/fclose_variation1.phpt @@ -10,11 +10,11 @@ fclose($s); try { echo fread($s2, strlen("getMessage(), "\n"; + 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..d8aeb52b8876 100644 --- a/ext/standard/tests/file/feof_basic.phpt +++ b/ext/standard/tests/file/feof_basic.phpt @@ -61,7 +61,7 @@ fclose($h); try { feof($h); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..44a2e7abe730 100644 --- a/ext/standard/tests/file/fgetc_variation2.phpt +++ b/ext/standard/tests/file/fgetc_variation2.phpt @@ -22,7 +22,7 @@ fclose($file_handle); try { var_dump( fgetc($file_handle) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..4745eabbc6f5 100644 --- a/ext/standard/tests/file/fgetcsv_error_conditions.phpt +++ b/ext/standard/tests/file/fgetcsv_error_conditions.phpt @@ -14,48 +14,48 @@ echo 'fgetcsv() with negative length' . \PHP_EOL; try { var_dump( fgetcsv($file_handle, -10, escape: "\\") ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump( fgetcsv($file_handle, -10, $delimiter, escape: "\\") ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump( fgetcsv($file_handle, -10, $delimiter, $enclosure, escape: "\\") ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } 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; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } 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; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } 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; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --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..e4f06abe6c63 100644 --- a/ext/standard/tests/file/fgetcsv_variation12.phpt +++ b/ext/standard/tests/file/fgetcsv_variation12.phpt @@ -72,7 +72,7 @@ foreach ($csv_lists as $csv_list) { try { var_dump( fgetcsv($file_handle, 1024, $del, $enc) ); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + 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..15cd403f70a9 100644 --- a/ext/standard/tests/file/fgetcsv_variation19.phpt +++ b/ext/standard/tests/file/fgetcsv_variation19.phpt @@ -70,7 +70,7 @@ foreach ($csv_lists as $csv_list) { try { var_dump( fgetcsv($file_handle, 1024, $del, escape: "\\") ); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + 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..071b14812f76 100644 --- a/ext/standard/tests/file/fgets_error.phpt +++ b/ext/standard/tests/file/fgets_error.phpt @@ -12,14 +12,14 @@ $len = 0; try { var_dump( fgets($fp, $len) ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $len = -10; try { var_dump( fgets($fp, $len) ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $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..00d7fd2ea03b 100644 --- a/ext/standard/tests/file/fgets_variation2.phpt +++ b/ext/standard/tests/file/fgets_variation2.phpt @@ -22,12 +22,12 @@ fclose($file_handle); try { var_dump( fgets($file_handle) ); // default length } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( fgets($file_handle, 10) ); // with specific length } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..3760f93d6bb0 100644 --- a/ext/standard/tests/file/file_error.phpt +++ b/ext/standard/tests/file/file_error.phpt @@ -10,12 +10,12 @@ $filename = $file_path."/file.tmp"; try { var_dump( file($filename, 10, NULL) ); // Incorrect flag } catch(ValueError $e) { - echo "ValueError: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( file($filename, FILE_APPEND) ); // Incorrect flag } catch(ValueError $e) { - echo "ValueError: " . $e->getMessage() . "\n"; + 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..3de6abf84a00 100644 --- a/ext/standard/tests/file/file_get_contents_error.phpt +++ b/ext/standard/tests/file/file_get_contents_error.phpt @@ -20,7 +20,7 @@ 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"; + 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..9ec4108f706d 100644 --- a/ext/standard/tests/file/file_get_contents_error002.phpt +++ b/ext/standard/tests/file/file_get_contents_error002.phpt @@ -10,8 +10,8 @@ display_errors=false try { file_get_contents("http://checkip.dyndns.com",null,null,0,-1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..c551af9ba48b 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 @@ -15,7 +15,7 @@ file_put_contents($file_path."/file_put_contents_error1.tmp", "Garbage data in t try { file_get_contents($file_path."/file_put_contents_error1.tmp", FALSE, NULL, 0, -5); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..19dc2b13178d 100644 --- a/ext/standard/tests/file/file_get_contents_variation8.phpt +++ b/ext/standard/tests/file/file_get_contents_variation8.phpt @@ -35,7 +35,7 @@ for( $i=0; $igetMessage(), "\n"; + 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..6e1cee41f4d3 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 @@ -11,7 +11,7 @@ try { ]); var_dump(file_get_contents("http://example.com", context: $context)); } catch (Error $e) { - echo $e->getMessage() . "\n"; + 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..855f96ce3b72 100644 --- a/ext/standard/tests/file/file_put_contents.phpt +++ b/ext/standard/tests/file/file_put_contents.phpt @@ -14,7 +14,7 @@ $context = stream_context_create(); try { var_dump(file_put_contents($file, $context)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(file_put_contents($file, new stdClass)); var_dump(file_put_contents($file, new foo)); @@ -22,7 +22,7 @@ $fp = fopen($file, "r"); try { var_dump(file_put_contents($file, "string", 0, $fp)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..545889985dff 100644 --- a/ext/standard/tests/file/file_put_contents_variation8.phpt +++ b/ext/standard/tests/file/file_put_contents_variation8.phpt @@ -45,7 +45,7 @@ for( $i=0; $igetMessage(), "\n"; + 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..6bbd27210dcc 100644 --- a/ext/standard/tests/file/file_variation6.phpt +++ b/ext/standard/tests/file/file_variation6.phpt @@ -12,7 +12,7 @@ for ($flags = 0; $flags <= 32; $flags++) { try { var_dump(file($filepath, $flags)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } @@ -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..6ca5f8cf84e7 100644 --- a/ext/standard/tests/file/filegroup_variation3.phpt +++ b/ext/standard/tests/file/filegroup_variation3.phpt @@ -35,7 +35,7 @@ foreach($files_arr as $file) { try { var_dump( filegroup( $file_path."/".$file ) ); } catch (Error $e) { - echo $e->getMessage(), "\n"; + 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..95cdfb3481e3 100644 --- a/ext/standard/tests/file/fileinode_variation3.phpt +++ b/ext/standard/tests/file/fileinode_variation3.phpt @@ -34,7 +34,7 @@ foreach($files_arr as $file) { try { var_dump( fileinode( $file_path."/".$file ) ); } catch (Error $e) { - echo $e->getMessage(), "\n"; + 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..c9d4f08f7ac1 100644 --- a/ext/standard/tests/file/fileowner_variation3.phpt +++ b/ext/standard/tests/file/fileowner_variation3.phpt @@ -35,7 +35,7 @@ foreach($files_arr as $file) { try { var_dump( fileowner( $file_path."/".$file ) ); } catch (Error $e) { - echo $e->getMessage(), "\n"; + 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..ee0c6b5d7d75 100644 --- a/ext/standard/tests/file/fileperms_variation3.phpt +++ b/ext/standard/tests/file/fileperms_variation3.phpt @@ -34,7 +34,7 @@ foreach($files_arr as $file) { try { var_dump( fileperms( $file_path."/".$file ) ); } catch (Error $e) { - echo $e->getMessage(), "\n"; + 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..af16c7bade9a 100644 --- a/ext/standard/tests/file/filesize_variation3.phpt +++ b/ext/standard/tests/file/filesize_variation3.phpt @@ -19,7 +19,7 @@ for($size = filesize($filename); $size>=-1200; $size-=1200) { try { var_dump( ftruncate($file_handle, $size) ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } 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..3ad16a08f222 100644 --- a/ext/standard/tests/file/flock.phpt +++ b/ext/standard/tests/file/flock.phpt @@ -11,7 +11,7 @@ fclose($fp); try { var_dump(flock($fp, LOCK_SH|LOCK_NB)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } /* @@ -42,7 +42,7 @@ var_dump(flock($fp, -1)); try { var_dump(flock($fp, 0)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -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..f37d25b5c01b 100644 --- a/ext/standard/tests/file/flock_error.phpt +++ b/ext/standard/tests/file/flock_error.phpt @@ -32,7 +32,7 @@ foreach($operations as $operation) { try { var_dump(flock($fp, $operation)); } catch (\TypeError|\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $i++; } @@ -44,7 +44,7 @@ fclose($fp); try { var_dump(flock($fp, LOCK_SH|LOCK_NB)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..860868d91f4c 100644 --- a/ext/standard/tests/file/fnmatch_variation.phpt +++ b/ext/standard/tests/file/fnmatch_variation.phpt @@ -65,7 +65,7 @@ for( $i = 0; $igetMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } unlink($file_name); @@ -81,7 +81,7 @@ function match_( $pattern, $string ) { try { var_dump( fnmatch($pattern[$i], $string[$j]) ); } catch (Error $e) { - echo $e->getMessage(), "\n"; + 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..c20446c53cdf 100644 --- a/ext/standard/tests/file/fputcsv_variation13.phpt +++ b/ext/standard/tests/file/fputcsv_variation13.phpt @@ -54,7 +54,7 @@ foreach ($csv_lists as $csv_list) { try { var_dump( fputcsv($file_handle, $csv_field, '+', '%%', escape: "\\") ); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + 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..a50713273ab0 100644 --- a/ext/standard/tests/file/fputcsv_variation9.phpt +++ b/ext/standard/tests/file/fputcsv_variation9.phpt @@ -53,7 +53,7 @@ foreach ($csv_lists as $csv_list) { try { var_dump( fputcsv($file_handle, $csv_field, '++', '%%') ); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + 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..f1128ce7485f 100644 --- a/ext/standard/tests/file/fread_error.phpt +++ b/ext/standard/tests/file/fread_error.phpt @@ -12,19 +12,19 @@ $len = 0; try { var_dump( fread($file_handle, $len) ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $len = -10; try { var_dump( fread($file_handle, $len) ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --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..5a46d3434d99 100644 --- a/ext/standard/tests/file/fscanf.phpt +++ b/ext/standard/tests/file/fscanf.phpt @@ -21,7 +21,7 @@ $fp = fopen($filename, "rt"); try { fscanf($fp, "%s", $v, $v1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump($v); var_dump($v1); @@ -33,7 +33,7 @@ $fp = fopen($filename, "rt"); try { fscanf($fp, "", $v, $v1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump($v); var_dump($v1); @@ -45,7 +45,7 @@ $fp = fopen($filename, "rt"); try { fscanf($fp, "%.a", $v, $v1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump($v); var_dump($v1); @@ -65,7 +65,7 @@ $fp = fopen($filename, "rt"); try { var_dump(fscanf($fp, "%s%d", $v)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..eb64d70d0c63 100644 --- a/ext/standard/tests/file/fscanf_error.phpt +++ b/ext/standard/tests/file/fscanf_error.phpt @@ -16,7 +16,7 @@ fclose($file_handle); try { fscanf($file_handle, "%s"); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // number of formats in format strings not matching the no of variables @@ -26,7 +26,7 @@ if ($file_handle == false) try { fscanf($file_handle, "%d%s%f", $int_var, $string_var); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } fclose($file_handle); @@ -42,7 +42,7 @@ foreach($invalid_formats as $format) { try { var_dump(fscanf($file_handle, $format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..2eb6c35ef6a8 100644 --- a/ext/standard/tests/file/fscanf_variation10.phpt +++ b/ext/standard/tests/file/fscanf_variation10.phpt @@ -59,7 +59,7 @@ foreach($float_formats as $float_format) { try { var_dump( fscanf($file_handle,$float_format) ); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..87675b338d6d 100644 --- a/ext/standard/tests/file/fscanf_variation11.phpt +++ b/ext/standard/tests/file/fscanf_variation11.phpt @@ -64,7 +64,7 @@ foreach($float_formats as $float_format) { try { var_dump(fscanf($file_handle,$float_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..57163980053d 100644 --- a/ext/standard/tests/file/fscanf_variation12.phpt +++ b/ext/standard/tests/file/fscanf_variation12.phpt @@ -65,7 +65,7 @@ foreach($float_formats as $float_format) { try { var_dump(fscanf($file_handle,$float_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..88d9def8d8fb 100644 --- a/ext/standard/tests/file/fscanf_variation13.phpt +++ b/ext/standard/tests/file/fscanf_variation13.phpt @@ -51,7 +51,7 @@ foreach($float_formats as $float_format) { try { var_dump(fscanf($file_handle,$float_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..e5b61697dad7 100644 --- a/ext/standard/tests/file/fscanf_variation14.phpt +++ b/ext/standard/tests/file/fscanf_variation14.phpt @@ -97,7 +97,7 @@ foreach($string_formats as $string_format) { try { var_dump(fscanf($file_handle,$string_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..4faeb9b771a9 100644 --- a/ext/standard/tests/file/fscanf_variation15.phpt +++ b/ext/standard/tests/file/fscanf_variation15.phpt @@ -67,7 +67,7 @@ foreach($string_formats as $string_format) { try { var_dump(fscanf($file_handle,$string_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..2d2125143383 100644 --- a/ext/standard/tests/file/fscanf_variation16.phpt +++ b/ext/standard/tests/file/fscanf_variation16.phpt @@ -58,7 +58,7 @@ foreach($string_formats as $string_format) { try { var_dump(fscanf($file_handle,$string_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..b5b27dea113b 100644 --- a/ext/standard/tests/file/fscanf_variation17.phpt +++ b/ext/standard/tests/file/fscanf_variation17.phpt @@ -63,7 +63,7 @@ foreach($string_formats as $string_format) { try { var_dump(fscanf($file_handle,$string_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..9fdf349d3f2e 100644 --- a/ext/standard/tests/file/fscanf_variation18.phpt +++ b/ext/standard/tests/file/fscanf_variation18.phpt @@ -71,7 +71,7 @@ foreach($string_formats as $string_format) { try { var_dump(fscanf($file_handle,$string_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..2b8202ab9f97 100644 --- a/ext/standard/tests/file/fscanf_variation19.phpt +++ b/ext/standard/tests/file/fscanf_variation19.phpt @@ -55,7 +55,7 @@ foreach($string_formats as $string_format) { try { var_dump(fscanf($file_handle,$string_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..289f3eb8a359 100644 --- a/ext/standard/tests/file/fscanf_variation2.phpt +++ b/ext/standard/tests/file/fscanf_variation2.phpt @@ -65,7 +65,7 @@ foreach($int_formats as $int_format) { try { var_dump(fscanf($file_handle,$int_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..f2b02c2d8a2b 100644 --- a/ext/standard/tests/file/fscanf_variation20.phpt +++ b/ext/standard/tests/file/fscanf_variation20.phpt @@ -69,7 +69,7 @@ foreach($char_formats as $char_format) { try { var_dump(fscanf($file_handle,$char_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..1a6442f46e47 100644 --- a/ext/standard/tests/file/fscanf_variation21.phpt +++ b/ext/standard/tests/file/fscanf_variation21.phpt @@ -67,7 +67,7 @@ foreach($char_formats as $char_format) { try { var_dump(fscanf($file_handle,$char_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..8d76ab8f9d56 100644 --- a/ext/standard/tests/file/fscanf_variation22.phpt +++ b/ext/standard/tests/file/fscanf_variation22.phpt @@ -58,7 +58,7 @@ foreach($char_formats as $char_format) { try { var_dump(fscanf($file_handle,$char_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..708bbb56315c 100644 --- a/ext/standard/tests/file/fscanf_variation23.phpt +++ b/ext/standard/tests/file/fscanf_variation23.phpt @@ -63,7 +63,7 @@ foreach($char_formats as $char_format) { try { var_dump(fscanf($file_handle,$char_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..cf61e3303627 100644 --- a/ext/standard/tests/file/fscanf_variation24.phpt +++ b/ext/standard/tests/file/fscanf_variation24.phpt @@ -69,7 +69,7 @@ foreach($char_formats as $char_format) { try { var_dump(fscanf($file_handle,$char_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..74878cbfb397 100644 --- a/ext/standard/tests/file/fscanf_variation25.phpt +++ b/ext/standard/tests/file/fscanf_variation25.phpt @@ -55,7 +55,7 @@ foreach($char_formats as $char_format) { try { var_dump(fscanf($file_handle,$char_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..8a0c26030aa3 100644 --- a/ext/standard/tests/file/fscanf_variation26.phpt +++ b/ext/standard/tests/file/fscanf_variation26.phpt @@ -50,7 +50,7 @@ foreach($char_formats as $char_format) { try { var_dump(fscanf($file_handle,$char_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..7a454f9d79e1 100644 --- a/ext/standard/tests/file/fscanf_variation27.phpt +++ b/ext/standard/tests/file/fscanf_variation27.phpt @@ -70,7 +70,7 @@ foreach($octal_formats as $octal_format) { try { var_dump(fscanf($file_handle,$octal_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..e9454d3d53ef 100644 --- a/ext/standard/tests/file/fscanf_variation28.phpt +++ b/ext/standard/tests/file/fscanf_variation28.phpt @@ -68,7 +68,7 @@ foreach($octal_formats as $octal_format) { try { var_dump(fscanf($file_handle,$octal_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..558bd79404cf 100644 --- a/ext/standard/tests/file/fscanf_variation29.phpt +++ b/ext/standard/tests/file/fscanf_variation29.phpt @@ -59,7 +59,7 @@ foreach($octal_formats as $octal_format) { try { var_dump(fscanf($file_handle,$octal_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..0a2d129bc49f 100644 --- a/ext/standard/tests/file/fscanf_variation30.phpt +++ b/ext/standard/tests/file/fscanf_variation30.phpt @@ -64,7 +64,7 @@ foreach($octal_formats as $octal_format) { try { var_dump(fscanf($file_handle,$octal_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..0e1648064181 100644 --- a/ext/standard/tests/file/fscanf_variation31.phpt +++ b/ext/standard/tests/file/fscanf_variation31.phpt @@ -65,7 +65,7 @@ foreach($octal_formats as $octal_format) { try { var_dump(fscanf($file_handle,$octal_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..f7b581b95575 100644 --- a/ext/standard/tests/file/fscanf_variation32.phpt +++ b/ext/standard/tests/file/fscanf_variation32.phpt @@ -56,7 +56,7 @@ foreach($octal_formats as $octal_format) { try { var_dump(fscanf($file_handle,$octal_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..5ce8712f6b56 100644 --- a/ext/standard/tests/file/fscanf_variation35.phpt +++ b/ext/standard/tests/file/fscanf_variation35.phpt @@ -54,7 +54,7 @@ foreach($hexa_formats as $hexa_format) { try { var_dump(fscanf($file_handle,$hexa_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..a1dfbdbc8de9 100644 --- a/ext/standard/tests/file/fscanf_variation36.phpt +++ b/ext/standard/tests/file/fscanf_variation36.phpt @@ -59,7 +59,7 @@ foreach($hexa_formats as $hexa_format) { try { var_dump(fscanf($file_handle,$hexa_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..24794d13c3c3 100644 --- a/ext/standard/tests/file/fscanf_variation37.phpt +++ b/ext/standard/tests/file/fscanf_variation37.phpt @@ -65,7 +65,7 @@ foreach($hexa_formats as $hexa_format) { try { var_dump(fscanf($file_handle,$hexa_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..ec22c5ec78d1 100644 --- a/ext/standard/tests/file/fscanf_variation38.phpt +++ b/ext/standard/tests/file/fscanf_variation38.phpt @@ -51,7 +51,7 @@ foreach($hexa_formats as $hexa_format) { try { var_dump(fscanf($file_handle,$hexa_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..2f362b7123a9 100644 --- a/ext/standard/tests/file/fscanf_variation4.phpt +++ b/ext/standard/tests/file/fscanf_variation4.phpt @@ -55,7 +55,7 @@ foreach($int_formats as $int_format) { try { var_dump(fscanf($file_handle,$int_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..ec4c67dc141e 100644 --- a/ext/standard/tests/file/fscanf_variation41.phpt +++ b/ext/standard/tests/file/fscanf_variation41.phpt @@ -54,7 +54,7 @@ foreach($unsigned_formats as $unsigned_format) { try { var_dump(fscanf($file_handle,$unsigned_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..2575fb6d65e1 100644 --- a/ext/standard/tests/file/fscanf_variation42.phpt +++ b/ext/standard/tests/file/fscanf_variation42.phpt @@ -59,7 +59,7 @@ foreach($unsigned_formats as $unsigned_format) { try { var_dump(fscanf($file_handle,$unsigned_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..ed7a0d47b778 100644 --- a/ext/standard/tests/file/fscanf_variation43.phpt +++ b/ext/standard/tests/file/fscanf_variation43.phpt @@ -65,7 +65,7 @@ foreach($unsigned_formats as $unsigned_format) { try { var_dump(fscanf($file_handle,$unsigned_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..41468629dd3d 100644 --- a/ext/standard/tests/file/fscanf_variation44.phpt +++ b/ext/standard/tests/file/fscanf_variation44.phpt @@ -51,7 +51,7 @@ foreach($unsigned_formats as $unsigned_format) { try { var_dump(fscanf($file_handle,$unsigned_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..db51db68039b 100644 --- a/ext/standard/tests/file/fscanf_variation45.phpt +++ b/ext/standard/tests/file/fscanf_variation45.phpt @@ -65,7 +65,7 @@ foreach($scientific_formats as $scientific_format) { try { var_dump(fscanf($file_handle,$scientific_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..29e0d510f7e7 100644 --- a/ext/standard/tests/file/fscanf_variation46.phpt +++ b/ext/standard/tests/file/fscanf_variation46.phpt @@ -63,7 +63,7 @@ foreach($scientific_formats as $scientific_format) { try { var_dump(fscanf($file_handle,$scientific_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..bd6509eb5e2f 100644 --- a/ext/standard/tests/file/fscanf_variation47.phpt +++ b/ext/standard/tests/file/fscanf_variation47.phpt @@ -54,7 +54,7 @@ foreach($scientific_formats as $scientific_format) { try { var_dump(fscanf($file_handle,$scientific_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..db771d2b409c 100644 --- a/ext/standard/tests/file/fscanf_variation48.phpt +++ b/ext/standard/tests/file/fscanf_variation48.phpt @@ -59,7 +59,7 @@ foreach($scientific_formats as $scientific_format) { try { var_dump(fscanf($file_handle,$scientific_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..36b87f292ab0 100644 --- a/ext/standard/tests/file/fscanf_variation49.phpt +++ b/ext/standard/tests/file/fscanf_variation49.phpt @@ -65,7 +65,7 @@ foreach($scientific_formats as $scientific_format) { try { var_dump(fscanf($file_handle,$scientific_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..885e91643e25 100644 --- a/ext/standard/tests/file/fscanf_variation5.phpt +++ b/ext/standard/tests/file/fscanf_variation5.phpt @@ -59,7 +59,7 @@ foreach($int_formats as $int_format) { try { var_dump(fscanf($file_handle,$int_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..6761e22da10f 100644 --- a/ext/standard/tests/file/fscanf_variation50.phpt +++ b/ext/standard/tests/file/fscanf_variation50.phpt @@ -51,7 +51,7 @@ foreach($scientific_formats as $scientific_format) { try { var_dump(fscanf($file_handle,$scientific_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..41069741bc3a 100644 --- a/ext/standard/tests/file/fscanf_variation6.phpt +++ b/ext/standard/tests/file/fscanf_variation6.phpt @@ -65,7 +65,7 @@ foreach($int_formats as $int_format) { try { var_dump(fscanf($file_handle,$int_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..3e555a82bd4f 100644 --- a/ext/standard/tests/file/fscanf_variation7.phpt +++ b/ext/standard/tests/file/fscanf_variation7.phpt @@ -51,7 +51,7 @@ foreach($int_formats as $int_format) { try { var_dump(fscanf($file_handle,$int_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..83fd2e6c0609 100644 --- a/ext/standard/tests/file/fscanf_variation8.phpt +++ b/ext/standard/tests/file/fscanf_variation8.phpt @@ -83,7 +83,7 @@ foreach($float_formats as $float_format) { try { var_dump(fscanf($file_handle,$float_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..d37c27ad76a6 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_error1.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_error1.phpt @@ -12,7 +12,7 @@ fclose($fp); try { var_dump(fseek($fp,10)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..50a4f297c21a 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_error2.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_error2.phpt @@ -12,7 +12,7 @@ fclose($fp); try { var_dump(ftell($fp)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..c7772fba82da 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_error3.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_error3.phpt @@ -12,7 +12,7 @@ fclose($fp); try { var_dump(rewind($fp)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..dd8f88a611c8 100644 --- a/ext/standard/tests/file/fstat.phpt +++ b/ext/standard/tests/file/fstat.phpt @@ -11,7 +11,7 @@ fclose($fp); try { var_dump(fstat($fp)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..64bc9d82bc58 100644 --- a/ext/standard/tests/file/ftruncate.phpt +++ b/ext/standard/tests/file/ftruncate.phpt @@ -35,7 +35,7 @@ $fp = fopen($filename, "a"); try { var_dump(ftruncate($fp, -1000000000)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } 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..a9adcbe48f90 100644 --- a/ext/standard/tests/file/ftruncate_error.phpt +++ b/ext/standard/tests/file/ftruncate_error.phpt @@ -18,7 +18,7 @@ fclose($file_handle); try { var_dump( ftruncate($file_handle,10) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..9a63b0e5becf 100644 --- a/ext/standard/tests/file/ftruncate_variation4.phpt +++ b/ext/standard/tests/file/ftruncate_variation4.phpt @@ -49,7 +49,7 @@ foreach($file_content_types as $file_content_type) { try { var_dump( ftruncate($file_handle, $new_size) ); // truncate it } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } 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..1ba9ff112ca6 100644 --- a/ext/standard/tests/file/fwrite_error.phpt +++ b/ext/standard/tests/file/fwrite_error.phpt @@ -24,7 +24,7 @@ fclose($file_handle); try { var_dump(fwrite($file_handle,"data")); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..57e539a5f60a 100644 --- a/ext/standard/tests/file/glob_variation.phpt +++ b/ext/standard/tests/file/glob_variation.phpt @@ -52,7 +52,7 @@ foreach($patterns as $pattern) { var_dump( glob($pattern, GLOB_NOESCAPE) ); var_dump( glob($pattern, GLOB_ERR) ); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $counter++; } @@ -78,7 +78,7 @@ foreach($patterns as $pattern) { try { var_dump( glob($pattern, GLOB_ONLYDIR) ); } catch (Error $e) { - echo $e->getMessage(), "\n"; + 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..09d9ea97b3d9 100644 --- a/ext/standard/tests/file/is_dir_variation4.phpt +++ b/ext/standard/tests/file/is_dir_variation4.phpt @@ -32,7 +32,7 @@ foreach($dirs_arr as $dir) { try { var_dump( is_dir($file_path."/".$dir ) ); } catch (Error $e) { - echo $e->getMessage(), "\n"; + 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..e16b5cdc773f 100644 --- a/ext/standard/tests/file/is_executable_variation1.phpt +++ b/ext/standard/tests/file/is_executable_variation1.phpt @@ -45,7 +45,7 @@ foreach($files_arr as $file) { try { var_dump( is_executable($file) ); } catch (Error $e) { - echo $e->getMessage(), "\n"; + 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..9969c8a0d1de 100644 --- a/ext/standard/tests/file/is_file_variation4.phpt +++ b/ext/standard/tests/file/is_file_variation4.phpt @@ -32,7 +32,7 @@ foreach($files_arr as $file) { try { var_dump( is_file( $file_path."/".$file ) ); } catch (Error $e) { - echo $e->getMessage(), "\n"; + 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..dd241ebc502e 100644 --- a/ext/standard/tests/file/is_readable_variation1.phpt +++ b/ext/standard/tests/file/is_readable_variation1.phpt @@ -44,7 +44,7 @@ foreach($files_arr as $file) { try { var_dump( is_readable($file) ); } catch (Error $e) { - echo $e->getMessage(), "\n"; + 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..a9a1ed92d811 100644 --- a/ext/standard/tests/file/is_writable_variation1.phpt +++ b/ext/standard/tests/file/is_writable_variation1.phpt @@ -43,12 +43,12 @@ foreach($files_arr as $file) { try { var_dump( is_writable($file) ); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( is_writeable($file) ); } catch (Error $e) { - echo $e->getMessage(), "\n"; + 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..2b6a4248b16d 100644 --- a/ext/standard/tests/file/mkdir_rmdir_variation2.phpt +++ b/ext/standard/tests/file/mkdir_rmdir_variation2.phpt @@ -26,12 +26,12 @@ 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"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( rmdir("$file_path/temp".chr(0)."/") ); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + 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..e72ee472e0f1 100644 --- a/ext/standard/tests/file/pathinfo_variation3.phpt +++ b/ext/standard/tests/file/pathinfo_variation3.phpt @@ -19,32 +19,32 @@ var_dump(pathinfo($testfile, PATHINFO_DIRNAME)); try { pathinfo($testfile, PATHINFO_EXTENSION|PATHINFO_FILENAME|PATHINFO_DIRNAME); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { pathinfo($testfile, PATHINFO_EXTENSION|PATHINFO_FILENAME); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { pathinfo($testfile, PATHINFO_EXTENSION|PATHINFO_DIRNAME); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { pathinfo($testfile, PATHINFO_FILENAME|PATHINFO_BASENAME); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { pathinfo($testfile, PATHINFO_DIRNAME|PATHINFO_EXTENSION); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { pathinfo($testfile, PATHINFO_DIRNAME|PATHINFO_BASENAME); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -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..915c9ea7be8a 100644 --- a/ext/standard/tests/file/popen_pclose_error.phpt +++ b/ext/standard/tests/file/popen_pclose_error.phpt @@ -6,23 +6,23 @@ Test popen() and pclose function: error conditions try { popen("abc.txt", "x"); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { popen("abc.txt", "rw"); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { popen("abc.txt", "rwb"); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..80e8bbd1d4d4 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 @@ -7,8 +7,8 @@ proc_open does not leak memory when called with wrong resource type in descripto proc_open('not_a_real_command_but_I_dont_care', array(0 => $context), $pipes); echo "Not reached"; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..63f3db84623a 100644 --- a/ext/standard/tests/file/readfile_error.phpt +++ b/ext/standard/tests/file/readfile_error.phpt @@ -11,12 +11,12 @@ echo "\n-- Testing readfile() with invalid arguments --\n"; try { var_dump( readfile('') ); // empty string as $filename } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump( readfile(false) ); // boolean false as $filename } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } 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..ae3fc04f9c3b 100644 --- a/ext/standard/tests/file/readfile_variation10.phpt +++ b/ext/standard/tests/file/readfile_variation10.phpt @@ -36,7 +36,7 @@ for( $i=0; $igetMessage(), "\n"; + 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..3eb17f61118c 100644 --- a/ext/standard/tests/file/stream_rfc2397_006.phpt +++ b/ext/standard/tests/file/stream_rfc2397_006.phpt @@ -17,14 +17,14 @@ foreach($streams as $stream) try { var_dump(file_get_contents($stream)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + 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..2444e8a25365 100644 --- a/ext/standard/tests/file/stream_supports_lock.phpt +++ b/ext/standard/tests/file/stream_supports_lock.phpt @@ -29,7 +29,7 @@ var_dump($sock); try { var_dump(stream_supports_lock($sock)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..e9b685a17c90 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 @@ -30,7 +30,7 @@ echo "\n*** Testing linkinfo() for error conditions ***\n"; try { var_dump(linkinfo('')); // empty string as linkname } catch (ValueError $e) { - echo $e->getMessage() . "\n"; + 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..84f117072993 100644 --- a/ext/standard/tests/file/tempnam_variation3.phpt +++ b/ext/standard/tests/file/tempnam_variation3.phpt @@ -37,7 +37,7 @@ for( $i=0; $igetMessage(), "\n"; + 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..0d0a51167f89 100644 --- a/ext/standard/tests/file/tempnam_variation7.phpt +++ b/ext/standard/tests/file/tempnam_variation7.phpt @@ -35,7 +35,7 @@ for( $i=0; $igetMessage(), "\n"; + 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..c1c9f45debda 100644 --- a/ext/standard/tests/file/tempnam_variation9.phpt +++ b/ext/standard/tests/file/tempnam_variation9.phpt @@ -31,7 +31,7 @@ foreach($names_arr as $i=>$prefix) { try { $file_name = tempnam("$file_path", $prefix); } catch (Error $e) { - echo $e->getMessage(), "\n"; + 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..c2744bfcc1cc 100644 --- a/ext/standard/tests/file/touch.phpt +++ b/ext/standard/tests/file/touch.phpt @@ -38,7 +38,7 @@ var_dump(touch("/no/such/file/or/directory")); try { touch("/no/such/file/or/directory", null, 1599492068); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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 d159b9612dbe..2a56ec46bc03 100644 --- a/ext/standard/tests/file/userstreams.phpt +++ b/ext/standard/tests/file/userstreams.phpt @@ -161,7 +161,7 @@ try { stream_wrapper_register("bogus", "class_not_exist"); die("Registered a non-existent class!!!???"); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } 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..e152151b5ced 100644 --- a/ext/standard/tests/file/userstreams_002.phpt +++ b/ext/standard/tests/file/userstreams_002.phpt @@ -26,7 +26,7 @@ function test($name, $fd, $return_value) { try { var_dump(stream_select($r, $w, $e, 0) !== false); } catch (TypeError|ValueError $e) { - echo $e->getMessage(), "\n"; + 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..44d68dce1718 100644 --- a/ext/standard/tests/file/userstreams_005.phpt +++ b/ext/standard/tests/file/userstreams_005.phpt @@ -42,7 +42,7 @@ test("stream_truncate size 10", $fd, 10); try { test("stream_truncate negative size", $fd, -1); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } 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..190da056de12 100644 --- a/ext/standard/tests/filters/bug54350.phpt +++ b/ext/standard/tests/filters/bug54350.phpt @@ -10,7 +10,7 @@ class user_filter extends php_user_filter { try { fclose($this->stream); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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/gh20370.phpt b/ext/standard/tests/filters/gh20370.phpt index abcf49bfc9f4..4a19c75dcffc 100644 --- a/ext/standard/tests/filters/gh20370.phpt +++ b/ext/standard/tests/filters/gh20370.phpt @@ -26,13 +26,13 @@ stream_filter_append($fp, "pass"); try { fwrite($fp, "data"); } catch (TypeError $e) { - echo $e::class, ": ", $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { fclose($fp); } catch (TypeError $e) { - echo $e::class, ": ", $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } unset($fp); // prevent cleanup at shutdown diff --git a/ext/standard/tests/filters/object_init_failure.phpt b/ext/standard/tests/filters/object_init_failure.phpt index 3a88d87ccab0..c09a93dd77bd 100644 --- a/ext/standard/tests/filters/object_init_failure.phpt +++ b/ext/standard/tests/filters/object_init_failure.phpt @@ -9,11 +9,11 @@ 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"; + 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..e648eca26b1d 100644 --- a/ext/standard/tests/filters/object_init_failure_2.phpt +++ b/ext/standard/tests/filters/object_init_failure_2.phpt @@ -9,11 +9,11 @@ stream_filter_register('sample.filter', SampleFilter::class); try { include 'php://filter/read=sample.filter/resource='. __FILE__; } catch (Error $e) { - echo $e->getMessage(), "\n"; + 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..3b551a836393 100644 --- a/ext/standard/tests/filters/stream_filter_remove_error.phpt +++ b/ext/standard/tests/filters/stream_filter_remove_error.phpt @@ -18,7 +18,7 @@ echo "\n-- Testing stream_filter_remove() function with bad resource --\n"; try { stream_filter_remove($fp); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "\n-- Testing stream_filter_remove() function with an already removed filter --\n"; @@ -27,7 +27,7 @@ var_dump(stream_filter_remove( $filter )); try { stream_filter_remove($filter); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + 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..31d64eb5bd3e 100644 --- a/ext/standard/tests/general_functions/010.phpt +++ b/ext/standard/tests/general_functions/010.phpt @@ -14,11 +14,11 @@ class test { try { var_dump(register_shutdown_function(array("test","__call"))); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + 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..3d6e3bc545ad 100644 --- a/ext/standard/tests/general_functions/bug25038.phpt +++ b/ext/standard/tests/general_functions/bug25038.phpt @@ -13,7 +13,7 @@ try } catch (Exception $e) { - print $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { @@ -21,10 +21,10 @@ try } catch (Exception $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..67516b8886e4 100644 --- a/ext/standard/tests/general_functions/bug31190.phpt +++ b/ext/standard/tests/general_functions/bug31190.phpt @@ -11,15 +11,16 @@ $array = array(new test(), 'throwException'); try { call_user_func($array, 1, 2); } catch (Exception $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { call_user_func_array($array, array(1, 2)); } catch (Exception $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --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..347000b5d994 100644 --- a/ext/standard/tests/general_functions/bug32647.phpt +++ b/ext/standard/tests/general_functions/bug32647.phpt @@ -19,37 +19,37 @@ unset($obj); try { register_shutdown_function(array($obj,"")); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { register_shutdown_function(array($obj,"some string")); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { register_shutdown_function(array(0,"")); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { register_shutdown_function(array('bar','foo')); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { register_shutdown_function(array(0,"some string")); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { register_shutdown_function('bar'); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } register_shutdown_function('foo'); @@ -57,7 +57,7 @@ register_shutdown_function('foo'); try { register_shutdown_function(array('bar','barfoo')); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $obj = new bar; @@ -65,7 +65,7 @@ $obj = new bar; try { register_shutdown_function(array($obj,'foobar')); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + 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..74162fc2a091 100644 --- a/ext/standard/tests/general_functions/bug41037.phpt +++ b/ext/standard/tests/general_functions/bug41037.phpt @@ -8,7 +8,7 @@ function a() { try { unregister_tick_function('a'); } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + 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..c18ccd181d2a 100644 --- a/ext/standard/tests/general_functions/bug41970.phpt +++ b/ext/standard/tests/general_functions/bug41970.phpt @@ -9,13 +9,13 @@ 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"; + 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"; + 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..2ad19d08db0f 100644 --- a/ext/standard/tests/general_functions/bug44295.phpt +++ b/ext/standard/tests/general_functions/bug44295.phpt @@ -18,12 +18,12 @@ try { print get_class($iter) . "\n"; print "after\n"; } catch (Exception $e) { - print "in catch: ".$e->getMessage()."\n"; + 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..d9bdfa25ba82 100644 --- a/ext/standard/tests/general_functions/bug47857.phpt +++ b/ext/standard/tests/general_functions/bug47857.phpt @@ -11,17 +11,17 @@ var_dump(is_callable(array('foo','bar'))); try { foo::bar(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(is_callable(array('Exception','getMessage'))); try { Exception::getMessage(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + 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..d5fe5c9942ec 100644 --- a/ext/standard/tests/general_functions/bug72920.phpt +++ b/ext/standard/tests/general_functions/bug72920.phpt @@ -9,8 +9,8 @@ class Foo { try { var_dump(constant('Foo::C1')); } catch (Error $e) { - echo $e->getMessage(), "\n"; + 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..63bed3c9793b 100644 --- a/ext/standard/tests/general_functions/callbacks_001.phpt +++ b/ext/standard/tests/general_functions/callbacks_001.phpt @@ -72,7 +72,7 @@ class P extends O { try { $this->call(array($this, 'B::who')); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..93cbcf07bd5c 100644 --- a/ext/standard/tests/general_functions/callbacks_002.phpt +++ b/ext/standard/tests/general_functions/callbacks_002.phpt @@ -6,21 +6,21 @@ call_user_func(): Wrong parameters try { call_user_func(array('Foo', 'bar')); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { call_user_func(array(NULL, 'bar')); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { call_user_func(array('stdclass', NULL)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..104f653f3b56 100644 --- a/ext/standard/tests/general_functions/dl_null_bytes.phpt +++ b/ext/standard/tests/general_functions/dl_null_bytes.phpt @@ -6,9 +6,9 @@ dl() rejects null bytes in extension filename try { dl("foo\0bar"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + 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..6d5b7058739a 100644 --- a/ext/standard/tests/general_functions/error_get_last.phpt +++ b/ext/standard/tests/general_functions/error_get_last.phpt @@ -7,7 +7,7 @@ var_dump(error_get_last()); try { var_dump(error_get_last(true)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..3f3664903303 100644 --- a/ext/standard/tests/general_functions/gettype_settype_basic.phpt +++ b/ext/standard/tests/general_functions/gettype_settype_basic.phpt @@ -97,7 +97,7 @@ foreach ($types as $type) { // check the new type var_dump( gettype($var) ); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..8c13d2d29fe3 100644 --- a/ext/standard/tests/general_functions/gettype_settype_error.phpt +++ b/ext/standard/tests/general_functions/gettype_settype_error.phpt @@ -12,7 +12,7 @@ echo "\n*** Testing settype(): error conditions ***\n"; try { settype( $var, "unknown" ); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..04b4082d7b50 100644 --- a/ext/standard/tests/general_functions/gh21058.phpt +++ b/ext/standard/tests/general_functions/gh21058.phpt @@ -6,8 +6,8 @@ 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; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --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..e5e0c4d99f6c 100644 --- a/ext/standard/tests/general_functions/gh9905.phpt +++ b/ext/standard/tests/general_functions/gh9905.phpt @@ -5,8 +5,8 @@ GH-9905 (constant() behaves inconsistent when class is undefined) try { \constant("\NonExistantClass::non_existant_constant"); } catch (\Throwable|\Error|\Exception $e) { - echo($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --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..ba7274d90a36 100644 --- a/ext/standard/tests/general_functions/ini_set_types.phpt +++ b/ext/standard/tests/general_functions/ini_set_types.phpt @@ -21,7 +21,7 @@ var_dump(ini_get('user_agent')); try { ini_set('foo', []); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..7089aede4cef 100644 --- a/ext/standard/tests/general_functions/is_countable_with_variables.phpt +++ b/ext/standard/tests/general_functions/is_countable_with_variables.phpt @@ -19,7 +19,7 @@ if (!is_countable($bar)) { try { count($bar); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } ?> @@ -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..822719c7e414 100644 --- a/ext/standard/tests/general_functions/proc_open_array.phpt +++ b/ext/standard/tests/general_functions/proc_open_array.phpt @@ -14,28 +14,28 @@ echo "Empty command array:\n"; try { proc_open([], $ds, $pipes); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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"; + 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"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "\nEmpty program name:\n"; try { proc_open([""], $ds, $pipes); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..da6419edfc1c 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 @@ -10,9 +10,9 @@ 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"; + 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..669b7127d164 100644 --- a/ext/standard/tests/general_functions/proc_open_pipes3.phpt +++ b/ext/standard/tests/general_functions/proc_open_pipes3.phpt @@ -18,7 +18,7 @@ $spec[$i] = 1; try { proc_open("$php -n $callee_escaped", $spec, $pipes); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..bb4a6284a567 100644 --- a/ext/standard/tests/general_functions/proc_open_redirect.phpt +++ b/ext/standard/tests/general_functions/proc_open_redirect.phpt @@ -7,19 +7,19 @@ $php = getenv('TEST_PHP_EXECUTABLE'); try { proc_open([$php], [['redirect']], $pipes); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { proc_open([$php], [['redirect', 'foo']], $pipes); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { proc_open([$php], [['redirect', 42]], $pipes); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..ff4d3572f24d 100644 --- a/ext/standard/tests/general_functions/putenv.phpt +++ b/ext/standard/tests/general_functions/putenv.phpt @@ -18,13 +18,13 @@ var_dump(getenv($var_name)); try { putenv("=123"); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { putenv(""); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..e980ab366766 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 @@ -7,7 +7,7 @@ foreach ([false, true] as $local_only) { try { getenv("PHP_GETENV_NUL_TEST\0SUFFIX", $local_only); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } @@ -20,7 +20,7 @@ foreach ([ try { putenv($assignment); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..5404015bfb6e 100644 --- a/ext/standard/tests/general_functions/register_tick_function_error.phpt +++ b/ext/standard/tests/general_functions/register_tick_function_error.phpt @@ -7,8 +7,8 @@ declare(ticks=1); try { register_tick_function("a"); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + 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..e2fce970f6fa 100644 --- a/ext/standard/tests/general_functions/settype_typed_property.phpt +++ b/ext/standard/tests/general_functions/settype_typed_property.phpt @@ -17,12 +17,12 @@ var_dump($test->x); try { settype($test->x, 'array'); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..abecb1578fb8 100644 --- a/ext/standard/tests/general_functions/sleep_usleep_uint_overflow.phpt +++ b/ext/standard/tests/general_functions/sleep_usleep_uint_overflow.phpt @@ -14,12 +14,12 @@ foreach (['sleep', 'usleep'] as $function) { try { $function(4294967296); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + 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..9db37a2de0a4 100644 --- a/ext/standard/tests/general_functions/type.phpt +++ b/ext/standard/tests/general_functions/type.phpt @@ -50,7 +50,7 @@ foreach ($types as $type) { try { var_dump(settype($var, $type)); } catch (Error $e) { - echo "Error: ", $e->getMessage(), "\n"; + 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..291ae260b17b 100644 --- a/ext/standard/tests/general_functions/unregister_tick_function_error.phpt +++ b/ext/standard/tests/general_functions/unregister_tick_function_error.phpt @@ -7,8 +7,8 @@ declare(ticks=1); try { unregister_tick_function("a"); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + 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/http_build_query/gh20583.phpt b/ext/standard/tests/http/http_build_query/gh20583.phpt index 2d93d3b6f448..74b5efd1b080 100644 --- a/ext/standard/tests/http/http_build_query/gh20583.phpt +++ b/ext/standard/tests/http/http_build_query/gh20583.phpt @@ -20,7 +20,7 @@ for ($i = 0; $i < 3000; $i++) { try { http_build_query($a, 'p'); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- 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..a915da3de55b 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 @@ -6,13 +6,13 @@ request_parse_body() invalid key try { request_parse_body(options: ['foo' => 1]); } catch (Error $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { request_parse_body(options: [42 => 1]); } catch (Error $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_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..5ae4b8dc8560 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 @@ -8,7 +8,7 @@ try { 'max_input_vars' => [], ]); } catch (Error $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_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..4fc431186717 100644 --- a/ext/standard/tests/mail/gh7875.phpt +++ b/ext/standard/tests/mail/gh7875.phpt @@ -35,7 +35,7 @@ try { mail('recipient@example.com', 'Subject', 'Body', []); echo 'Not Reached'; } catch (\Exception $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; 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..c5be7464f3bf 100644 --- a/ext/standard/tests/mail/mail_basic7.phpt +++ b/ext/standard/tests/mail/mail_basic7.phpt @@ -44,49 +44,49 @@ $message = 'A Message'; try { mail($to, $subject, $message, ['orig-date' => array('foo1')]); } catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; + 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"; + 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"; + 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"; + 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"; + 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"; + 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"; + 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"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "\n\n************* TEST ******************\n"; @@ -99,43 +99,43 @@ $message = 'A Message'; try { mail($to, $subject, $message, ['foo1' => array('foo2'=>'bar1')]); } catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; + 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"; + 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"; + 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"; + 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"; + 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"; + 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"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "\n\n************* TEST ******************\n"; @@ -151,49 +151,49 @@ $outFile = "mailBasic7.out"; try { mail($to, $subject, $message, ['*:foo1' => array('bar1')]); } catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; + 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"; + 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"; + 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"; + 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"; + 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"; + 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"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ["foo8" => array()]); } catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump(mail($to, $subject, $message, ["foo9" => '%&$#!'])); @@ -203,7 +203,7 @@ unlink($outFile); try { mail($to, $subject, $message, ["foo10" => "abc\0\tdef"]); } catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; + 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..b20874f0000d 100644 --- a/ext/standard/tests/mail/mail_null_bytes.phpt +++ b/ext/standard/tests/mail/mail_null_bytes.phpt @@ -6,33 +6,33 @@ mail() with null bytes in arguments try { mail("foo\0bar", "x", "y"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { mail("x", "foo\0bar", "y"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { mail("x", "y", "foo\0bar"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { mail("x", "y", "z", "foo\0bar"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { mail("x", "y", "z", "q", "foo\0bar"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + 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..b74f9a9d2053 100644 --- a/ext/standard/tests/math/abs_variation.phpt +++ b/ext/standard/tests/math/abs_variation.phpt @@ -71,7 +71,7 @@ foreach($inputs as $input) { try { var_dump(abs($input)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..7acce904e018 100644 --- a/ext/standard/tests/math/base_convert_error.phpt +++ b/ext/standard/tests/math/base_convert_error.phpt @@ -12,23 +12,23 @@ class classA try { base_convert(1234, 1, 10); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { base_convert(1234, 10, 37); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { base_convert(new classA(), 8, 10); } catch (Error $e) { - echo $e->getMessage(), "\n"; + 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..5093059fc91d 100644 --- a/ext/standard/tests/math/base_convert_variation1.phpt +++ b/ext/standard/tests/math/base_convert_variation1.phpt @@ -55,7 +55,7 @@ foreach($inputs as $input) { try { var_dump(base_convert($input, 10, 8)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + 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..c5a48f79ea41 100644 --- a/ext/standard/tests/math/bindec_variation1_64bit.phpt +++ b/ext/standard/tests/math/bindec_variation1_64bit.phpt @@ -58,7 +58,7 @@ foreach($inputs as $input) { try { var_dump(bindec($input)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..dcf201bfc00c 100644 --- a/ext/standard/tests/math/ceil_variation1.phpt +++ b/ext/standard/tests/math/ceil_variation1.phpt @@ -65,7 +65,7 @@ foreach($inputs as $input) { try { var_dump(ceil($input)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..225650a00e20 100644 --- a/ext/standard/tests/math/clamp.phpt +++ b/ext/standard/tests/math/clamp.phpt @@ -23,13 +23,13 @@ function check_clamp_exception($value, $min, $max) { try { var_dump(clamp($value, $min, $max)); } catch (ValueError $error) { - echo $error->getMessage(), "\n"; + echo $error::class, ': ', $error->getMessage(), "\n"; } try { var_dump(make_clamp_fcc()($value, $min, $max)); } catch (ValueError $error) { - echo $error->getMessage(), "\n"; + 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..6985b43b8d2e 100644 --- a/ext/standard/tests/math/decbin_basic.phpt +++ b/ext/standard/tests/math/decbin_basic.phpt @@ -20,7 +20,7 @@ foreach ($values as $value) { try { var_dump(decbin($value)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + 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..08e4c5a4427d 100644 --- a/ext/standard/tests/math/decbin_basiclong_64bit.phpt +++ b/ext/standard/tests/math/decbin_basiclong_64bit.phpt @@ -24,7 +24,7 @@ foreach ($longVals as $longVal) { try { var_dump(decbin($longVal)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + 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..c158c04f08d7 100644 --- a/ext/standard/tests/math/decbin_variation1_64bit.phpt +++ b/ext/standard/tests/math/decbin_variation1_64bit.phpt @@ -40,7 +40,7 @@ foreach ($inputs as $i => $input) { try { var_dump(decbin($input)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + 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..11fee0bd0d65 100644 --- a/ext/standard/tests/math/dechex_basic.phpt +++ b/ext/standard/tests/math/dechex_basic.phpt @@ -20,7 +20,7 @@ foreach ($values as $value) { try { var_dump(dechex($value)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + 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..49474abab6ef 100644 --- a/ext/standard/tests/math/dechex_basiclong_64bit.phpt +++ b/ext/standard/tests/math/dechex_basiclong_64bit.phpt @@ -24,7 +24,7 @@ foreach ($longVals as $longVal) { try { var_dump(dechex($longVal)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + 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..755a85d1369f 100644 --- a/ext/standard/tests/math/dechex_variation1_64bit.phpt +++ b/ext/standard/tests/math/dechex_variation1_64bit.phpt @@ -40,7 +40,7 @@ foreach ($inputs as $i => $input) { try { var_dump(dechex($input)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + 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..6ac5f5cebb25 100644 --- a/ext/standard/tests/math/decoct_basic.phpt +++ b/ext/standard/tests/math/decoct_basic.phpt @@ -20,7 +20,7 @@ foreach ($values as $value) { try { var_dump(decoct($value)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + 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..36e73eee5c34 100644 --- a/ext/standard/tests/math/decoct_basiclong_64bit.phpt +++ b/ext/standard/tests/math/decoct_basiclong_64bit.phpt @@ -24,7 +24,7 @@ foreach ($longVals as $longVal) { try { var_dump(decoct($longVal)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + 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..03ca88a035ff 100644 --- a/ext/standard/tests/math/decoct_variation1_64bit.phpt +++ b/ext/standard/tests/math/decoct_variation1_64bit.phpt @@ -40,7 +40,7 @@ foreach ($inputs as $i => $input) { try { var_dump(decoct($input)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + 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..b883e9e79cf9 100644 --- a/ext/standard/tests/math/floor_variation1.phpt +++ b/ext/standard/tests/math/floor_variation1.phpt @@ -65,7 +65,7 @@ foreach($inputs as $input) { try { var_dump(floor($input)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..f19bf2756fb5 100644 --- a/ext/standard/tests/math/gh17384.phpt +++ b/ext/standard/tests/math/gh17384.phpt @@ -12,14 +12,14 @@ foreach ([1.23456, 1] as $number) { try { number_format($number, $decimals); } catch (ValueError $exception) { - echo $exception->getMessage(), "\n"; + 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..504d7ec0dbd4 100644 --- a/ext/standard/tests/math/hexdec_variation1_64bit.phpt +++ b/ext/standard/tests/math/hexdec_variation1_64bit.phpt @@ -62,7 +62,7 @@ foreach($inputs as $input) { try { var_dump(hexdec($input)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..7d766f7ee574 100644 --- a/ext/standard/tests/math/log_error.phpt +++ b/ext/standard/tests/math/log_error.phpt @@ -7,8 +7,8 @@ precision=14 try { log(36, -4); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..9884385ac3b8 100644 --- a/ext/standard/tests/math/octdec_variation1.phpt +++ b/ext/standard/tests/math/octdec_variation1.phpt @@ -58,7 +58,7 @@ foreach($inputs as $input) { try { var_dump(octdec($input)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..7f5d473b094f 100644 --- a/ext/standard/tests/math/pow_variation1_64bit.phpt +++ b/ext/standard/tests/math/pow_variation1_64bit.phpt @@ -59,7 +59,7 @@ foreach ($inputs as $input) { try { var_dump(pow($input, 3)); } catch (Error $e) { - echo $e->getMessage(), "\n"; + 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..4ebc36ddb96a 100644 --- a/ext/standard/tests/math/pow_variation2.phpt +++ b/ext/standard/tests/math/pow_variation2.phpt @@ -55,7 +55,7 @@ foreach ($inputs as $input) { try { var_dump(pow(20.3, $input)); } catch (Error $e) { - echo $e->getMessage(), "\n"; + 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..b6b6797946f4 100644 --- a/ext/standard/tests/math/round_valid_rounding_mode.phpt +++ b/ext/standard/tests/math/round_valid_rounding_mode.phpt @@ -5,8 +5,8 @@ round() rejects invalid rounding modes. try { var_dump(round(1.5, mode: 1234)); } catch (ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --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..cda59ae980ca 100644 --- a/ext/standard/tests/math/round_variation1.phpt +++ b/ext/standard/tests/math/round_variation1.phpt @@ -79,7 +79,7 @@ foreach($inputs as $input) { try { var_dump(round($input, 14)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..a8a6291c1f92 100644 --- a/ext/standard/tests/misc/exec_basic1.phpt +++ b/ext/standard/tests/misc/exec_basic1.phpt @@ -11,20 +11,20 @@ $cmd = "echo abc\n\0command"; try { var_dump(exec($cmd, $output)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(system($cmd, $output)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(passthru($cmd, $output)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --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..9e2899cc6345 100644 --- a/ext/standard/tests/misc/gh14774.phpt +++ b/ext/standard/tests/misc/gh14774.phpt @@ -10,14 +10,14 @@ foreach([INF, -INF, 10e300, -10e300, NAN, -NAN] as $var) { try { time_sleep_until($var); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } ?> --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..c06eca2630c5 100644 --- a/ext/standard/tests/network/bug69523.phpt +++ b/ext/standard/tests/network/bug69523.phpt @@ -5,8 +5,8 @@ setcookie() allows empty cookie name try { setcookie('', 'foo'); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --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..e2608dd53456 100644 --- a/ext/standard/tests/network/bug69948.phpt +++ b/ext/standard/tests/network/bug69948.phpt @@ -5,18 +5,18 @@ Bug #69948 (path/domain are not sanitized for special characters in setcookie) try { var_dump(setcookie('foo', 'bar', 0, 'asdf;asdf')); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(setcookie('foo', 'bar', 0, '/', 'foobar; secure')); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> ===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..1243a9452bf8 100644 --- a/ext/standard/tests/network/bug79405.phpt +++ b/ext/standard/tests/network/bug79405.phpt @@ -6,14 +6,14 @@ $host = "localhost\0.example.com"; try { var_dump(gethostbyname($host)); } catch(Error $e) { - print $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(gethostbynamel($host)); } catch(Error $e) { - print $e->getMessage()."\n"; + 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..755301c3a959 100644 --- a/ext/standard/tests/network/dns_check_record_error_conditions.phpt +++ b/ext/standard/tests/network/dns_check_record_error_conditions.phpt @@ -5,15 +5,15 @@ dns_check_record() error conditions try { dns_check_record(''); } catch (\ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { // A random DNS Mode dns_check_record('php.net', 15263480); } catch (\ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..abd2356daf05 100644 --- a/ext/standard/tests/network/dns_get_record_error_conditions.phpt +++ b/ext/standard/tests/network/dns_get_record_error_conditions.phpt @@ -6,7 +6,7 @@ try { // A random DNS Mode dns_get_record('php.net', 15263480); } catch (\ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { // DNS Mode 0 @@ -14,7 +14,7 @@ try { $additional = []; dns_get_record('php.net', 0, $auth, $additional, true); } catch (\ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { // A random DNS Mode @@ -22,10 +22,10 @@ try { $additional = []; dns_get_record('php.net', 15263480, $auth, $additional, true); } catch (\ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..c11bd4fc712d 100644 --- a/ext/standard/tests/network/ghsa-www2-q4fc-65wf.phpt +++ b/ext/standard/tests/network/ghsa-www2-q4fc-65wf.phpt @@ -7,56 +7,56 @@ This is a ZPP test but *keep* this as it is security-sensitive! try { dns_check_record("\0"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { dns_get_mx("\0", $out); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { dns_get_record("\0"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { getprotobyname("\0"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { getservbyname("\0", "tcp"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { getservbyname("x", "tcp\0"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { getservbyport(0, "tcp\0"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { inet_pton("\0"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { ip2long("\0"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + 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..5bf64fd55c35 100644 --- a/ext/standard/tests/network/openlog_null_bytes.phpt +++ b/ext/standard/tests/network/openlog_null_bytes.phpt @@ -9,8 +9,8 @@ if (!function_exists("openlog")) die("skip openlog() is not available"); try { openlog("foo\0bar", LOG_NDELAY, LOG_USER); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + 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..12be0c5225c1 100644 --- a/ext/standard/tests/network/setcookie_array_option_error.phpt +++ b/ext/standard/tests/network/setcookie_array_option_error.phpt @@ -11,44 +11,44 @@ ob_start(); try { setcookie('name', 'value', ['unknown_key' => 'only']); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + 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"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // Unrecognized key try { setcookie('name3', 'value3', ['path' => '/path/', 'foo' => 'bar']); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // Invalid path key content try { setcookie('name', 'value', ['path' => '/;/']); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + 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"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // Partitioned without secure try { setcookie('name', 'value', ['partitioned' => true]); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + 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"; + 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..1543dbc7db87 100644 --- a/ext/standard/tests/network/setcookie_error.phpt +++ b/ext/standard/tests/network/setcookie_error.phpt @@ -10,27 +10,27 @@ ob_start(); try { setcookie(''); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { setcookie('invalid='); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { setcookie('name', 'invalid;'); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { setcookie('name', 'value', 100, 'invalid;'); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { setcookie('name', 'value', 100, 'path', 'invalid;'); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + 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..a4fc3b3abd79 100644 --- a/ext/standard/tests/network/setrawcookie_error.phpt +++ b/ext/standard/tests/network/setrawcookie_error.phpt @@ -10,27 +10,27 @@ ob_start(); try { setrawcookie(''); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { setrawcookie('invalid='); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { setrawcookie('name', 'invalid;'); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { setrawcookie('name', 'value', 100, 'invalid;'); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { setrawcookie('name', 'value', 100, 'path', 'invalid;'); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + 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..15d30eb91f07 100644 --- a/ext/standard/tests/password/password_bcrypt_errors.phpt +++ b/ext/standard/tests/password/password_bcrypt_errors.phpt @@ -6,22 +6,22 @@ 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"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { var_dump(password_hash("foo", PASSWORD_BCRYPT, array("cost" => 32))); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { var_dump(password_hash("null\0password", PASSWORD_BCRYPT)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + 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..684e9d4afb25 100644 --- a/ext/standard/tests/password/password_hash_error.phpt +++ b/ext/standard/tests/password/password_hash_error.phpt @@ -7,37 +7,37 @@ Test error operation of password_hash() try { var_dump(password_hash("foo")); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { password_hash("foo", array()); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { var_dump(password_hash("foo", 19, new StdClass)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(password_hash("foo", PASSWORD_BCRYPT, "baz")); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(password_hash(array(), PASSWORD_BCRYPT)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..af38d571cf26 100644 --- a/ext/standard/tests/password/password_needs_rehash_error.phpt +++ b/ext/standard/tests/password/password_needs_rehash_error.phpt @@ -6,32 +6,32 @@ Test error operation of password_needs_rehash() try { var_dump(password_needs_rehash('')); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(password_needs_rehash('', [])); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(password_needs_rehash(array(), PASSWORD_BCRYPT)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(password_needs_rehash("", PASSWORD_BCRYPT, "foo")); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..5d0763d1a357 100644 --- a/ext/standard/tests/password/password_verify_error.phpt +++ b/ext/standard/tests/password/password_verify_error.phpt @@ -7,9 +7,9 @@ Test error operation of password_verify() try { var_dump(password_verify("foo")); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..671e52c78631 100644 --- a/ext/standard/tests/poll/gh22759.phpt +++ b/ext/standard/tests/poll/gh22759.phpt @@ -26,7 +26,7 @@ var_dump($second->isActive()); try { $second->remove(); } catch (Io\Poll\InactiveWatcherException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "done\n"; @@ -34,5 +34,5 @@ echo "done\n"; --EXPECT-- NULL bool(false) -Cannot remove inactive watcher -done +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..b32a57e848a3 100644 --- a/ext/standard/tests/poll/poll_clone_not_allowed.phpt +++ b/ext/standard/tests/poll/poll_clone_not_allowed.phpt @@ -13,14 +13,14 @@ foreach ([$ctx, $handle, $watcher] as $obj) { try { clone $obj; } catch (Error $e) { - echo $e->getMessage(), "\n"; + 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..bcefd2e05d0b 100644 --- a/ext/standard/tests/poll/poll_ctx_backend_unix.phpt +++ b/ext/standard/tests/poll/poll_ctx_backend_unix.phpt @@ -19,10 +19,10 @@ var_dump($backend->name); try { new Io\Poll\Context(Io\Poll\Backend::WSAPoll); } catch (\Io\Poll\BackendUnavailableException $e) { - var_dump($e->getMessage()); + 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..43729b9c4c39 100644 --- a/ext/standard/tests/poll/poll_double_construct.phpt +++ b/ext/standard/tests/poll/poll_double_construct.phpt @@ -10,19 +10,19 @@ $handle = new StreamPollHandle($r); try { $handle->__construct($r); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $ctx = pt_new_stream_poll(); try { $ctx->__construct(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + 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..4ab36d47dd06 100644 --- a/ext/standard/tests/poll/poll_stream_add_error_duplicate.phpt +++ b/ext/standard/tests/poll/poll_stream_add_error_duplicate.phpt @@ -12,8 +12,8 @@ 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"; + 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..9a76612be852 100644 --- a/ext/standard/tests/poll/poll_watcher_outlives_context.phpt +++ b/ext/standard/tests/poll/poll_watcher_outlives_context.phpt @@ -17,19 +17,19 @@ var_dump($watcher->isActive()); try { $watcher->remove(); } catch (Io\Poll\InactiveWatcherException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $watcher->modifyEvents([Io\Poll\Event::Write]); } catch (Io\Poll\InactiveWatcherException $e) { - echo $e->getMessage(), "\n"; + 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..4184e1c595c5 100644 --- a/ext/standard/tests/serialize/__serialize_002.phpt +++ b/ext/standard/tests/serialize/__serialize_002.phpt @@ -12,9 +12,9 @@ class Test { try { serialize(new Test); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..fac825849469 100644 --- a/ext/standard/tests/serialize/__serialize_007.phpt +++ b/ext/standard/tests/serialize/__serialize_007.phpt @@ -7,9 +7,9 @@ $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"; + 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..f1024537c517 100644 --- a/ext/standard/tests/serialize/bug64354_1.phpt +++ b/ext/standard/tests/serialize/bug64354_1.phpt @@ -11,15 +11,15 @@ spl_autoload_register( try { var_dump(unserialize('O:1:"A":0:{}')); } catch (Exception $e) { - var_dump($e->getMessage()); + 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()); + 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..6828b9df0798 100644 --- a/ext/standard/tests/serialize/bug64354_2.phpt +++ b/ext/standard/tests/serialize/bug64354_2.phpt @@ -17,8 +17,8 @@ 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()); + 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..3a6d21697f23 100644 --- a/ext/standard/tests/serialize/bug64354_3.phpt +++ b/ext/standard/tests/serialize/bug64354_3.phpt @@ -22,9 +22,9 @@ $data = array(new A, new B); try { serialize($data); } catch (Exception $e) { - var_dump($e->getMessage()); + 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..474494721ce5 100644 --- a/ext/standard/tests/serialize/bug73341.phpt +++ b/ext/standard/tests/serialize/bug73341.phpt @@ -6,14 +6,14 @@ 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"; + 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"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { @@ -21,13 +21,13 @@ $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"; + 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..20271e227d35 100644 --- a/ext/standard/tests/serialize/bug81111.phpt +++ b/ext/standard/tests/serialize/bug81111.phpt @@ -11,7 +11,7 @@ class MySplFileInfo extends SplFileInfo { try { serialize(new MySplFileInfo(__FILE__)); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $anon = new class () { @@ -22,32 +22,32 @@ $anon = new class () { try { serialize($anon); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize("O:13:\"MySplFileInfo\":0:{}"); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize("C:13:\"MySplFileInfo\":0:{}"); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $name = $anon::class; try { unserialize("O:" . strlen($name) . ":\"" . $name . "\":0:{}"); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + 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..916ec8c2f7c2 100644 --- a/ext/standard/tests/serialize/gh15169.phpt +++ b/ext/standard/tests/serialize/gh15169.phpt @@ -28,7 +28,7 @@ for ($i = 0; $i < 30000; $i++) { try { serialize($firstNode); } catch (Error $e) { - echo $e->getMessage(), "\n"; + 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..a2564d0e0720 100644 --- a/ext/standard/tests/serialize/incomplete_class.phpt +++ b/ext/standard/tests/serialize/incomplete_class.phpt @@ -10,7 +10,7 @@ var_dump($o); try { $o->test = "a"; } catch (Error $e) { - echo $e->getMessage(), "\n"; + 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..2a48ab40a551 100644 --- a/ext/standard/tests/serialize/max_depth.phpt +++ b/ext/standard/tests/serialize/max_depth.phpt @@ -15,13 +15,13 @@ echo "Invalid max_depth:\n"; try { unserialize('i:0;', ['max_depth' => 'foo']); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { unserialize('i:0;', ['max_depth' => -1]); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..ee8f95f86f8d 100644 --- a/ext/standard/tests/serialize/serialization_objects_005.phpt +++ b/ext/standard/tests/serialize/serialization_objects_005.phpt @@ -38,7 +38,7 @@ try { $ref2 = "ref1.original"; $incomplete->p = &$ref2; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($incomplete->p); $ref2 = "ref1.changed"; @@ -46,7 +46,7 @@ var_dump($incomplete->p); try { $incomplete->p = "p.changed"; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($ref1); @@ -54,20 +54,20 @@ var_dump(isset($incomplete->x)); try { $incomplete->x = "x.new"; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(isset($incomplete->x)); try { unset($incomplete->x); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($incomplete->x); try { $incomplete->f(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + 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..e316f32c56b9 100644 --- a/ext/standard/tests/serialize/serialization_objects_010.phpt +++ b/ext/standard/tests/serialize/serialization_objects_010.phpt @@ -14,12 +14,12 @@ Class C implements Serializable { try { var_dump(serialize(new C)); } catch (Exception $e) { - echo $e->getMessage(). "\n"; + 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..e791d0a0ae11 100644 --- a/ext/standard/tests/serialize/splobjectstorage_negative_count.phpt +++ b/ext/standard/tests/serialize/splobjectstorage_negative_count.phpt @@ -9,9 +9,9 @@ $str = 'C:16:"SplObjectStorage":25:{x:i:-9223372036854775808;}'; try { var_dump(unserialize($str)); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + 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..23677cce8adf 100644 --- a/ext/standard/tests/serialize/typed_property_ref_assignment_failure.phpt +++ b/ext/standard/tests/serialize/typed_property_ref_assignment_failure.phpt @@ -13,7 +13,7 @@ STR; try { var_dump(unserialize($s)); } catch (Error $e) { - echo $e->getMessage(), "\n"; + 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..70481aa74fff 100644 --- a/ext/standard/tests/serialize/typed_property_refs.phpt +++ b/ext/standard/tests/serialize/typed_property_refs.phpt @@ -35,27 +35,27 @@ 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"; + 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"; + 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"; + 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"; + 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"; + 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..ab7fc26b026c 100644 --- a/ext/standard/tests/serialize/unserialize_abstract_class.phpt +++ b/ext/standard/tests/serialize/unserialize_abstract_class.phpt @@ -7,9 +7,9 @@ $payload = 'O:23:"RecursiveFilterIterator":0:{}'; try { var_dump(unserialize($payload)); } catch (Error $e) { - echo $e->getMessage(), "\n"; + 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..ba7a9f31b938 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 @@ -11,24 +11,24 @@ $s = serialize($z); try { unserialize($s, ["allowed_classes" => null]); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { unserialize($s, ["allowed_classes" => 0]); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { unserialize($s, ["allowed_classes" => 1]); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + 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..85a5ef433058 100644 --- a/ext/standard/tests/serialize/unserialize_callback_func/non_existing.phpt +++ b/ext/standard/tests/serialize/unserialize_callback_func/non_existing.phpt @@ -6,8 +6,8 @@ ini_set('unserialize_callback_func','Nonexistent'); try { unserialize('O:3:"FOO":0:{}'); } catch (Error $e) { - echo $e->getMessage(), "\n"; + 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..be2f176df103 100644 --- a/ext/standard/tests/serialize/unserialize_leak.phpt +++ b/ext/standard/tests/serialize/unserialize_leak.phpt @@ -7,10 +7,10 @@ $payload = 'C:16:"SplObjectStorage":113:{x:i:2;O:8:"stdClass":1:{},a:2:{s:4:"pre try { var_dump(unserialize($payload)); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + 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..ceebc93b4eed 100644 --- a/ext/standard/tests/setcookie_samesite_validation.phpt +++ b/ext/standard/tests/setcookie_samesite_validation.phpt @@ -22,19 +22,19 @@ var_dump(setrawcookie('test', 'value', ['samesite' => 'Lax'])); try { setcookie('test', 'value', ['samesite' => 'Invalid']); } catch (ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { setcookie('test', 'value', ['samesite' => "Strict\r\nX-Injected: evil"]); } catch (ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { setrawcookie('test', 'value', ['samesite' => 'Invalid']); } catch (ValueError $e) { - echo $e->getMessage() . "\n"; + 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..6493ec7eaf8b 100644 --- a/ext/standard/tests/streams/bug44712.phpt +++ b/ext/standard/tests/streams/bug44712.phpt @@ -6,8 +6,8 @@ $ctx = stream_context_get_default(); try { stream_context_set_params($ctx, array("options" => 1)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + 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..f811db0221d1 100644 --- a/ext/standard/tests/streams/bug54623.phpt +++ b/ext/standard/tests/streams/bug54623.phpt @@ -12,10 +12,10 @@ fclose($sock2); try { fwrite($sock, "3"); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..cf1dc6be2e17 100644 --- a/ext/standard/tests/streams/bug61115.phpt +++ b/ext/standard/tests/streams/bug61115.phpt @@ -10,8 +10,8 @@ stream_context_set_params($resourceFileTemp, array()); try { preg_replace('', function() {}, $resourceFileTemp); } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; + 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..cbffdd7a12b2 100644 --- a/ext/standard/tests/streams/bug67626.phpt +++ b/ext/standard/tests/streams/bug67626.phpt @@ -33,15 +33,15 @@ $fp = fopen('my://foobar', 'r+'); try { fread($fp, 42); } catch (Exception $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), "\n"; } -echo "\n"; + try { fwrite($fp, 'foobar'); } catch (Exception $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --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..91c349a3ed76 100644 --- a/ext/standard/tests/streams/bug71884.phpt +++ b/ext/standard/tests/streams/bug71884.phpt @@ -7,8 +7,8 @@ $arr[0]['A']=0; try { stream_context_get_default($arr); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..35eb85d84431 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(), PHP_EOL; } ?> --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..93ffb77a6cb3 100644 --- a/ext/standard/tests/streams/gh14506.phpt +++ b/ext/standard/tests/streams/gh14506.phpt @@ -65,13 +65,13 @@ $empty = []; try { stream_select($streams, $streams,$empty, 0); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } fflush($readStream); try { fclose($readStream); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..3459caa6c26b 100644 --- a/ext/standard/tests/streams/gh14780.phpt +++ b/ext/standard/tests/streams/gh14780.phpt @@ -11,28 +11,28 @@ $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; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { pfsockopen('udp://127.0.0.1', '63844', $code, $err, (PHP_INT_MIN/100000)-1); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } 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; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { pfsockopen('udp://127.0.0.1', '63844', $code, $err, INF); } catch (\ValueError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --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..fa5c7dda7f54 100644 --- a/ext/standard/tests/streams/gh15908.phpt +++ b/ext/standard/tests/streams/gh15908.phpt @@ -27,7 +27,7 @@ $f = fopen("test://", "r"); try { file_put_contents(__DIR__."/gh15908.tmp", $f, FILE_USE_INCLUDE_PATH, $f); } catch (Error $e) { - echo $e->getMessage(), "\n"; + 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..f965df30983f 100644 --- a/ext/standard/tests/streams/non_finite_values.phpt +++ b/ext/standard/tests/streams/non_finite_values.phpt @@ -7,7 +7,7 @@ foreach ([NAN, -NAN, INF, -INF] as $value) { try { stream_socket_accept($socket, $value); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } fclose($socket); @@ -16,16 +16,16 @@ 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"; + 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..8e9d3c9590f4 100644 --- a/ext/standard/tests/streams/stream_context_create_error.phpt +++ b/ext/standard/tests/streams/stream_context_create_error.phpt @@ -5,22 +5,22 @@ Test the error cases of stream_context_create() try { stream_context_create(['ssl' => "abc"]); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { stream_context_create(['ssl' => ['verify_peer'=> false]], ["options" => ['ssl' => "abc"]]); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { stream_context_create(['ssl' => ['verify_peer'=> false]], ["options" => false]); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + 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..edd2437be108 100644 --- a/ext/standard/tests/streams/stream_context_set_option_error.phpt +++ b/ext/standard/tests/streams/stream_context_set_option_error.phpt @@ -7,29 +7,29 @@ $ctx = stream_context_create(); try { stream_context_set_option($ctx, [], "x"); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { stream_context_set_option($ctx, [], null, "x"); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { stream_context_set_option($ctx, "x"); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { stream_context_set_option($ctx, "x", "y"); } catch (Error $e) { - echo $e->getMessage(), "\n"; + 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..7b09373948dc 100644 --- a/ext/standard/tests/streams/stream_context_set_options_error.phpt +++ b/ext/standard/tests/streams/stream_context_set_options_error.phpt @@ -14,8 +14,8 @@ $process = proc_open('nothing', $description, $pipes); try { stream_context_set_options($process, []); } catch (TypeError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --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..8192aa07b495 100644 --- a/ext/standard/tests/streams/stream_errors_exception_mode_terminal.phpt +++ b/ext/standard/tests/streams/stream_errors_exception_mode_terminal.phpt @@ -12,7 +12,7 @@ $context = stream_context_create([ try { $stream = fopen('php://nonexistent', 'r', false, $context); } catch (StreamException $e) { - echo "Caught: " . $e->getMessage() . "\n"; + 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..99dda7655fdf 100644 --- a/ext/standard/tests/streams/stream_errors_mix_modes_storage.phpt +++ b/ext/standard/tests/streams/stream_errors_mix_modes_storage.phpt @@ -41,7 +41,7 @@ function stream_test_errors($title, $contextOptions) { $except = NULL; stream_select($read, $write, $except, 0, 0, $context); } catch (StreamException $e) { - echo 'EXCEPTION: ' . $e->getMessage() . "\n"; + 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..0cceb880331c 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 @@ -10,9 +10,9 @@ try { ] ]); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + 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..53b5f3d8edfb 100644 --- a/ext/standard/tests/streams/stream_get_contents_negative_length.phpt +++ b/ext/standard/tests/streams/stream_get_contents_negative_length.phpt @@ -10,10 +10,10 @@ var_dump(stream_get_contents($tmp, 2, 1)); try { stream_get_contents($tmp, -2); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..7f013fbe4482 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 @@ -10,7 +10,7 @@ fclose($fp); try { var_dump(stream_get_meta_data($fp)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..7674f29f6fb2 100644 --- a/ext/standard/tests/streams/stream_read_object_return.phpt +++ b/ext/standard/tests/streams/stream_read_object_return.phpt @@ -18,8 +18,8 @@ stream_wrapper_register('mystream', MyStream::class); try { var_dump(file_get_contents('mystream://')); } catch (Error $e) { - echo $e->getMessage(), "\n"; + 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..ca4997196a87 100644 --- a/ext/standard/tests/streams/stream_set_chunk_size.phpt +++ b/ext/standard/tests/streams/stream_set_chunk_size.phpt @@ -53,12 +53,12 @@ echo "\nerror conditions\n"; try { stream_set_chunk_size($f, 0); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { stream_set_chunk_size($f, -1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..ac446d4b1828 100644 --- a/ext/standard/tests/streams/stream_set_timeout_error.phpt +++ b/ext/standard/tests/streams/stream_set_timeout_error.phpt @@ -23,7 +23,7 @@ fclose($client); try { var_dump( stream_set_timeout($client, $seconds) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..18ec991eda85 100644 --- a/ext/standard/tests/strings/bug33605.phpt +++ b/ext/standard/tests/strings/bug33605.phpt @@ -5,9 +5,9 @@ Bug #33605 (substr_compare crashes) try { substr_compare("aa", "a", -99999999, -1, 0); } catch (\ValueError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --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..a9618489f1d1 100644 --- a/ext/standard/tests/strings/bug36944.phpt +++ b/ext/standard/tests/strings/bug36944.phpt @@ -6,7 +6,7 @@ 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; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(strncmp("test ", "e", 10)); var_dump(strncmp("test ", "e", 0)); @@ -14,16 +14,16 @@ var_dump(strncmp("test ", "e", 0)); try { var_dump(strncasecmp("test ", "E", -1)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } 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..b1623852750c 100644 --- a/ext/standard/tests/strings/bug40754.phpt +++ b/ext/standard/tests/strings/bug40754.phpt @@ -13,61 +13,61 @@ var_dump(strcspn("abcde", "abc", $v, $v)); try { var_dump(substr_count("abcde", "abc", $v, $v)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { substr_compare("abcde", "abc", $v, $v); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { stripos("abcde", "abc", $v); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { substr_count("abcde", "abc", $v, 1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { substr_count("abcde", "abc", 1, $v); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { strpos("abcde", "abc", $v); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { stripos("abcde", "abc", $v); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { strrpos("abcde", "abc", $v); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { strripos("abcde", "abc", $v); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { strripos("abcde", "abc", $v); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..6515b89ea9bf 100644 --- a/ext/standard/tests/strings/bug54322.phpt +++ b/ext/standard/tests/strings/bug54322.phpt @@ -5,8 +5,8 @@ Bug #54322: Null pointer deref in get_html_translation_table due to information try { var_dump(get_html_translation_table(NAN, 0, "UTF-8") > 0); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..244ce29abcc9 100644 --- a/ext/standard/tests/strings/bug67249.phpt +++ b/ext/standard/tests/strings/bug67249.phpt @@ -5,8 +5,8 @@ Bug #67249 (printf out-of-bounds read) try { var_dump(sprintf("%'", "foo")); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + 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..631204268d77 100644 --- a/ext/standard/tests/strings/bug69751.phpt +++ b/ext/standard/tests/strings/bug69751.phpt @@ -6,23 +6,23 @@ 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"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { sprintf('%3$s, %2$s %1$s', "a", "b"); } catch (ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { sprintf('%2147483648$s, %2$s %1$s', "a", "b"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + 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..a4d638c4e93e 100644 --- a/ext/standard/tests/strings/bug78833.phpt +++ b/ext/standard/tests/strings/bug78833.phpt @@ -5,8 +5,8 @@ Bug #78833 (Integer overflow in pack causes out-of-bound access) try { var_dump(pack("E2E2147483647H*", 0x0, 0x0, 0x0)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + 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..0b94bfc7a79d 100644 --- a/ext/standard/tests/strings/chr_error.phpt +++ b/ext/standard/tests/strings/chr_error.phpt @@ -9,7 +9,7 @@ echo "\n-- Testing chr() function with no arguments --\n"; try { var_dump( chr() ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Testing chr() function with more than expected no. of arguments --\n"; @@ -17,7 +17,7 @@ $extra_arg = 10; try { var_dump( chr(72, $extra_arg) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..d4ada8ba14f9 100644 --- a/ext/standard/tests/strings/chunk_split_variation5.phpt +++ b/ext/standard/tests/strings/chunk_split_variation5.phpt @@ -35,9 +35,9 @@ for($count = 0; $count < count($values); $count++) { try { var_dump( chunk_split($str, $values[$count], $ending) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + 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..00d58c6b87e5 100644 --- a/ext/standard/tests/strings/chunk_split_variation8.phpt +++ b/ext/standard/tests/strings/chunk_split_variation8.phpt @@ -43,9 +43,9 @@ for($count = 0; $count < count($values); $count++) { try { var_dump( chunk_split($heredoc_str, $values[$count], $ending) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + 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..ab5f5c6a30af 100644 --- a/ext/standard/tests/strings/count_chars_basic.phpt +++ b/ext/standard/tests/strings/count_chars_basic.phpt @@ -17,7 +17,7 @@ var_dump(bin2hex(count_chars($string, 4))); try { count_chars($string, 5); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + 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..c9c5837cc111 100644 --- a/ext/standard/tests/strings/crypt.phpt +++ b/ext/standard/tests/strings/crypt.phpt @@ -21,7 +21,7 @@ echo (CRYPT_BLOWFISH) ? ((crypt($str, $salt4) === $res_4) ? 'BLO' : 'BLO - ERROR try { var_dump(crypt($str)); } catch (ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + 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..550c487964bc 100644 --- a/ext/standard/tests/strings/dirname_error.phpt +++ b/ext/standard/tests/strings/dirname_error.phpt @@ -8,10 +8,10 @@ echo "*** Testing error conditions ***\n"; try { dirname("/var/tmp/bar.gz", 0); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + 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..081668487978 100644 --- a/ext/standard/tests/strings/dirname_multi.phpt +++ b/ext/standard/tests/strings/dirname_multi.phpt @@ -11,13 +11,13 @@ for ($i=0 ; $i<5 ; $i++) { try { var_dump(dirname("/foo/bar/baz", $i)); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + 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..3d41319100f1 100644 --- a/ext/standard/tests/strings/explode.phpt +++ b/ext/standard/tests/strings/explode.phpt @@ -17,17 +17,17 @@ echo "\n"; try { var_dump(explode("", "")); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(explode("", NULL)); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(explode(NULL, "")); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(explode("a", "")); @@ -36,7 +36,7 @@ var_dump(explode("a", NULL)); try { var_dump(explode(NULL, "a")); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + 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..90fe352d16ed 100644 --- a/ext/standard/tests/strings/explode1.phpt +++ b/ext/standard/tests/strings/explode1.phpt @@ -30,22 +30,22 @@ foreach($delimiters as $delimiter) { try { var_dump( explode($delimiter, $string, -1) ); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( explode($delimiter, $string, 0) ); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( explode($delimiter, $string, 1) ); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( explode($delimiter, $string, 2) ); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + 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..b65db01f912f 100644 --- a/ext/standard/tests/strings/fprintf_error.phpt +++ b/ext/standard/tests/strings/fprintf_error.phpt @@ -10,28 +10,28 @@ echo "*** Testing Error Conditions ***\n"; try { var_dump( fprintf() ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } /* scalar argument */ try { var_dump( fprintf(3) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } /* NULL argument */ try { var_dump( fprintf(NULL) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..ce6567d01953 100644 --- a/ext/standard/tests/strings/gh18823_strict.phpt +++ b/ext/standard/tests/strings/gh18823_strict.phpt @@ -6,14 +6,14 @@ declare(strict_types=1); try { setlocale(LC_ALL, 0, "0"); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { setlocale(LC_ALL, "0", 0); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..0144016b0197 100644 --- a/ext/standard/tests/strings/gh18823_weak.phpt +++ b/ext/standard/tests/strings/gh18823_weak.phpt @@ -24,8 +24,8 @@ setlocale(LC_ALL, new MyStringable); try { setlocale(LC_ALL, new MyStringableThrow); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -no +Error: no diff --git a/ext/standard/tests/strings/gh20906_1.phpt b/ext/standard/tests/strings/gh20906_1.phpt index ccb0dfbee566..e2ecb3991326 100644 --- a/ext/standard/tests/strings/gh20906_1.phpt +++ b/ext/standard/tests/strings/gh20906_1.phpt @@ -17,7 +17,7 @@ class A { try { new A; } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- diff --git a/ext/standard/tests/strings/implode_error.phpt b/ext/standard/tests/strings/implode_error.phpt index 417b3591e0dd..902629b8989f 100644 --- a/ext/standard/tests/strings/implode_error.phpt +++ b/ext/standard/tests/strings/implode_error.phpt @@ -6,24 +6,24 @@ Test implode() function: error conditions try { var_dump(implode("glue")); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } /* NULL as pieces */ try { var_dump(implode("glue", NULL)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } /* integer as glue */ try { var_dump(implode(12, "pieces")); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..d4ba5e6bb328 100644 --- a/ext/standard/tests/strings/implode_variation.phpt +++ b/ext/standard/tests/strings/implode_variation.phpt @@ -50,7 +50,7 @@ foreach($glues as $glue) { try { var_dump(implode($glue, $pieces)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $counter++; } @@ -60,7 +60,7 @@ echo "\n*** Testing implode() on empty string ***\n"; try { implode(""); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } /* checking sub-arrays */ @@ -70,12 +70,12 @@ var_dump(implode("TEST", $sub_array)); try { var_dump(implode(array(1, 2, 3, 4), $sub_array)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { var_dump(implode(2, $sub_array)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + 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..8e0b8378a93b 100644 --- a/ext/standard/tests/strings/join_error.phpt +++ b/ext/standard/tests/strings/join_error.phpt @@ -11,7 +11,7 @@ $glue = 'string_val'; try { var_dump(join($glue)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..27a7741b72e9 100644 --- a/ext/standard/tests/strings/join_error1.phpt +++ b/ext/standard/tests/strings/join_error1.phpt @@ -85,7 +85,7 @@ for($index = 0; $index < count($values); $index ++) { try { var_dump(join($glue, $pieces)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..5092f395718f 100644 --- a/ext/standard/tests/strings/join_variation1.phpt +++ b/ext/standard/tests/strings/join_variation1.phpt @@ -74,7 +74,7 @@ for($index = 0; $index < count($values); $index ++) { try { var_dump(join($glue, $pieces)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + 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..94875ac75bc1 100644 --- a/ext/standard/tests/strings/join_variation4.phpt +++ b/ext/standard/tests/strings/join_variation4.phpt @@ -41,7 +41,7 @@ for($index = 0; $index < count($glues); $index ++) { try { var_dump(join($glues[$index], $pieces)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + 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..b5bbbd1a947d 100644 --- a/ext/standard/tests/strings/join_variation5.phpt +++ b/ext/standard/tests/strings/join_variation5.phpt @@ -16,7 +16,7 @@ var_dump(join("TEST", $sub_array)); try { var_dump(join(array(1, 2, 3, 4), $sub_array)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + 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..30122f5dad5e 100644 --- a/ext/standard/tests/strings/levenshtein_error_conditions.phpt +++ b/ext/standard/tests/strings/levenshtein_error_conditions.phpt @@ -10,14 +10,14 @@ var_dump(levenshtein('AbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdef try { var_dump(levenshtein('AbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuv', 'A')); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo '--- String 2 ---' . \PHP_EOL; var_dump(levenshtein('A', 'AbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsu')); try { var_dump(levenshtein('A', 'AbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuv')); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } // 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..7f927942545e 100644 --- a/ext/standard/tests/strings/md5_file.phpt +++ b/ext/standard/tests/strings/md5_file.phpt @@ -32,7 +32,7 @@ echo "\n*** Testing for error conditions ***\n"; try { var_dump( md5_file("") ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } /* 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 6b8f5c1c89d9..ddb9ca99992b 100644 --- a/ext/standard/tests/strings/metaphone.phpt +++ b/ext/standard/tests/strings/metaphone.phpt @@ -9,7 +9,7 @@ var_dump(metaphone(-1)); try { var_dump(metaphone("valid phrase", -1)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(metaphone("valid phrase", 0)); var_dump(metaphone("valid phrase", 10000)); @@ -30,7 +30,7 @@ echo "Done\n"; --EXPECT-- string(0) "" string(0) "" -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 string(6) "FLTFRS" string(6) "FLTFRS" string(26) "0FLFRWRTKRFLNKHTLSLN0KLTR0" diff --git a/ext/standard/tests/strings/parse_str_null_bytes.phpt b/ext/standard/tests/strings/parse_str_null_bytes.phpt index fd0d94bb0fc8..f3690ae858db 100644 --- a/ext/standard/tests/strings/parse_str_null_bytes.phpt +++ b/ext/standard/tests/strings/parse_str_null_bytes.phpt @@ -6,9 +6,9 @@ parse_str() rejects null bytes try { parse_str("a=1\0&b=2", $result); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + 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..caf57db9cc4b 100644 --- a/ext/standard/tests/strings/pathinfo.phpt +++ b/ext/standard/tests/strings/pathinfo.phpt @@ -18,43 +18,43 @@ var_dump(pathinfo(__FILE__, PATHINFO_DIRNAME)); try { pathinfo(__FILE__, PATHINFO_EXTENSION|PATHINFO_FILENAME|PATHINFO_DIRNAME); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { pathinfo(__FILE__, PATHINFO_EXTENSION|PATHINFO_FILENAME); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { pathinfo(__FILE__, PATHINFO_EXTENSION|PATHINFO_DIRNAME); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { pathinfo(__FILE__, PATHINFO_FILENAME|PATHINFO_BASENAME); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { pathinfo(__FILE__, PATHINFO_DIRNAME|PATHINFO_EXTENSION); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { pathinfo(__FILE__, PATHINFO_DIRNAME|PATHINFO_BASENAME); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { pathinfo(__FILE__, PATHINFO_DIRNAME-1); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { pathinfo(__FILE__, PATHINFO_ALL+1); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } 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..f1d7fc1e11ef 100644 --- a/ext/standard/tests/strings/printf_64bit.phpt +++ b/ext/standard/tests/strings/printf_64bit.phpt @@ -31,7 +31,7 @@ echo "\n*** Output for zero argument ***\n"; try { printf(); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } /* Number of arguments not matching as specified in format field */ @@ -42,12 +42,12 @@ $name = "voudras"; try { printf("%d $string %s", $nbr, $name); } catch (\ArgumentCountError $e) { - print('Error found: '.$e->getMessage()); + 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 */ @@ -205,10 +205,10 @@ echo"\n\n*** Output for invalid width(-15) specifier ***\n"; try { printf("%030.-15s", $tempstring); } catch (ValueError $e) { - echo $e->getMessage(); + 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..14cfbaf7015d 100644 --- a/ext/standard/tests/strings/printf_error.phpt +++ b/ext/standard/tests/strings/printf_error.phpt @@ -9,7 +9,7 @@ echo "\n-- Testing printf() function with Zero arguments --\n"; try { var_dump( printf() ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Testing printf() function with less than expected no. of arguments --\n"; @@ -23,36 +23,36 @@ echo "\n-- Call printf with one argument less than expected --\n"; try { var_dump( printf($format1) ); } catch (\ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( printf($format2,$arg1) ); } catch (\ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( printf($format3,$arg1,$arg2) ); } catch (\ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + 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"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( printf($format3,$arg1) ); } catch (\ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + 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"; + 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..daad8004bce2 100644 --- a/ext/standard/tests/strings/setlocale_null_byte.phpt +++ b/ext/standard/tests/strings/setlocale_null_byte.phpt @@ -11,37 +11,37 @@ class NullByteStringable { try { var_dump(setlocale(LC_ALL, "C\0locale")); } catch (ValueError $e) { - echo $e::class, ": ", $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(setlocale(LC_ALL, ["locale\0name", "C"])); } catch (ValueError $e) { - echo $e::class, ": ", $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(@setlocale(LC_ALL, [str_repeat("x", 255), "C\0locale"])); } catch (ValueError $e) { - echo $e::class, ": ", $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(setlocale(LC_ALL, "zz_ZZ.nope", ["C\0locale"])); } catch (TypeError $e) { - echo $e::class, ": ", $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(setlocale(LC_ALL, "zz_ZZ.nope", new NullByteStringable())); } catch (ValueError $e) { - echo $e::class, ": ", $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(setlocale(LC_ALL, [], new NullByteStringable())); } catch (ArgumentCountError $e) { - echo $e::class, ": ", $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- diff --git a/ext/standard/tests/strings/sha1_file.phpt b/ext/standard/tests/strings/sha1_file.phpt index 2014eabb98f5..b08d6e54f023 100644 --- a/ext/standard/tests/strings/sha1_file.phpt +++ b/ext/standard/tests/strings/sha1_file.phpt @@ -35,7 +35,7 @@ echo "\n-- No filename --\n"; try { var_dump( sha1_file("") ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "\n-- invalid filename --\n"; @@ -48,7 +48,7 @@ echo "\n-- NULL as filename --\n"; try { var_dump( sha1_file(NULL) ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } 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..0d9fc331458a 100644 --- a/ext/standard/tests/strings/sprintf_error.phpt +++ b/ext/standard/tests/strings/sprintf_error.phpt @@ -9,7 +9,7 @@ echo "\n-- Testing sprintf() function with Zero arguments --\n"; try { var_dump( sprintf() ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Testing sprintf() function with less than expected no. of arguments --\n"; @@ -23,48 +23,48 @@ $arg2 = 'two'; try { var_dump( sprintf($format1) ); } catch (\ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( sprintf($format2,$arg1) ); } catch (\ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( sprintf($format3,$arg1,$arg2) ); } catch (\ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // with two argument less than expected try { var_dump( sprintf($format2) ); } catch (\ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( sprintf($format3,$arg1) ); } catch (\ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // with three argument less than expected try { var_dump( sprintf($format3) ); } catch (\ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(sprintf('%100$d %d')); } catch (\ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(sprintf("foo %", 42)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + 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..09b4765dc626 100644 --- a/ext/standard/tests/strings/sprintf_star.phpt +++ b/ext/standard/tests/strings/sprintf_star.phpt @@ -41,37 +41,37 @@ echo "\n"; try { printf("%.*G\n", "foo", 1.5); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { printf("%.*G\n", -100, 1.5); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { printf("%.*s\n", -1, "Foo"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { printf("%*G\n", -1, $f); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { printf("%9999999999999999999999.f\n", $f); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { printf("%.9999999999999999999999f\n", $f); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + 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..8918727d024d 100644 --- a/ext/standard/tests/strings/sprintf_variation1.phpt +++ b/ext/standard/tests/strings/sprintf_variation1.phpt @@ -73,21 +73,21 @@ foreach($values as $value) { try { var_dump(sprintf($value)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } // with two arguments try { var_dump(sprintf($value, $arg1)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } // with three arguments try { var_dump(sprintf($value, $arg1, $arg2)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + 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..a3feb0b57784 100644 --- a/ext/standard/tests/strings/sprintf_variation52.phpt +++ b/ext/standard/tests/strings/sprintf_variation52.phpt @@ -21,7 +21,7 @@ echo"\n-- Testing for invalid width(-15) specifier --\n"; try { var_dump(sprintf("%030.-15s", $tempstring)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + 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..18a001d6b06f 100644 --- a/ext/standard/tests/strings/sprintf_variation54.phpt +++ b/ext/standard/tests/strings/sprintf_variation54.phpt @@ -12,7 +12,7 @@ foreach ($formats as $format) { try { echo sprintf("%" . $format, $value), "\n"; } catch (Error $e) { - echo $e->getMessage(), "\n"; + 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..7a6b0d834b22 100644 --- a/ext/standard/tests/strings/sscanf_error.phpt +++ b/ext/standard/tests/strings/sscanf_error.phpt @@ -13,11 +13,11 @@ 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"; + 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..ad07ddff5860 100644 --- a/ext/standard/tests/strings/str_decrement_errors.phpt +++ b/ext/standard/tests/strings/str_decrement_errors.phpt @@ -31,23 +31,23 @@ foreach ($strings as $s) { try { var_dump(str_decrement($s)); } catch (ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } ?> --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..438d324dea42 100644 --- a/ext/standard/tests/strings/str_decrement_underflow.phpt +++ b/ext/standard/tests/strings/str_decrement_underflow.phpt @@ -17,16 +17,16 @@ foreach ($strings as $s) { try { var_dump(str_decrement($s)); } catch (ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } ?> --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..3d7f06a7d274 100644 --- a/ext/standard/tests/strings/str_increment_errors.phpt +++ b/ext/standard/tests/strings/str_increment_errors.phpt @@ -31,23 +31,23 @@ foreach ($strings as $s) { try { var_dump(str_increment($s)); } catch (ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } ?> --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..36db7695f57e 100644 --- a/ext/standard/tests/strings/str_pad.phpt +++ b/ext/standard/tests/strings/str_pad.phpt @@ -67,7 +67,7 @@ echo "\n--- empty padding string ---\n"; try { str_pad($input_string, 12, ""); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } /* bad pad_type - passing an undefined one */ @@ -75,7 +75,7 @@ try { try { str_pad($input_string, $pad_length, "+", 15); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + 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..7f6a811c3bc0 100644 --- a/ext/standard/tests/strings/str_pad_variation1.phpt +++ b/ext/standard/tests/strings/str_pad_variation1.phpt @@ -21,7 +21,7 @@ $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"; + 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..cd3b6345e05e 100644 --- a/ext/standard/tests/strings/str_repeat.phpt +++ b/ext/standard/tests/strings/str_repeat.phpt @@ -31,7 +31,7 @@ echo "\n\n*** Testing error conditions ***\n"; try { str_repeat($input[0], -1); // Invalid arg for multiplier } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + 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..cc4704ebcb38 100644 --- a/ext/standard/tests/strings/str_replace_basic.phpt +++ b/ext/standard/tests/strings/str_replace_basic.phpt @@ -24,7 +24,7 @@ $fp_copy = $fp; try { var_dump( str_replace($fp_copy, $fp_copy, $fp_copy, $fp_copy) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..77f8a2070ffe 100644 --- a/ext/standard/tests/strings/str_replace_variation3.phpt +++ b/ext/standard/tests/strings/str_replace_variation3.phpt @@ -83,7 +83,7 @@ var_dump($count); try { str_replace("a", array("q", "q", "c"), array("aaa"), $count); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump(str_replace("a", 1, array("aaa", "bbb"), $count)); @@ -99,12 +99,12 @@ $resource2 = opendir( "." ); try { var_dump(str_replace("stream", "FOUND", $resource1, $count)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(str_replace("stream", "FOUND", $resource2, $count)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..4c70d9223df8 100644 --- a/ext/standard/tests/strings/str_split_variation6.phpt +++ b/ext/standard/tests/strings/str_split_variation6.phpt @@ -28,14 +28,14 @@ for($count = 0; $count < count($values); $count++) { try { var_dump( str_split($str, $values[$count]) ); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + 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..b07956c4d5dc 100644 --- a/ext/standard/tests/strings/str_split_variation7.phpt +++ b/ext/standard/tests/strings/str_split_variation7.phpt @@ -30,14 +30,14 @@ for($count = 0; $count < count($values); $count++) { try { var_dump( str_split($str, $values[$count]) ); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + 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..38b0451e5735 100644 --- a/ext/standard/tests/strings/str_word_count.phpt +++ b/ext/standard/tests/strings/str_word_count.phpt @@ -12,25 +12,25 @@ var_dump(str_word_count($str)); try { var_dump(str_word_count($str, 3)); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(str_word_count($str, 123)); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(str_word_count($str, -1)); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(str_word_count($str, 999999999)); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + 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..9c4589826242 100644 --- a/ext/standard/tests/strings/str_word_count1.phpt +++ b/ext/standard/tests/strings/str_word_count1.phpt @@ -8,23 +8,23 @@ var_dump(str_word_count("")); try { var_dump(str_word_count("", -1)); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(str_word_count("", -1, $a)); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + 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..93d8c7a840e1 100644 --- a/ext/standard/tests/strings/strip_tags_variation2.phpt +++ b/ext/standard/tests/strings/strip_tags_variation2.phpt @@ -75,7 +75,7 @@ foreach($values as $value) { try { var_dump(strip_tags($string, $value)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + 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..8d3415807294 100644 --- a/ext/standard/tests/strings/stripos_error.phpt +++ b/ext/standard/tests/strings/stripos_error.phpt @@ -8,14 +8,14 @@ echo "\n-- Offset beyond the end of the string --\n"; try { stripos("Hello World", "o", 12); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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"; + 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..395f44cbf1ca 100644 --- a/ext/standard/tests/strings/stristr_variation2.phpt +++ b/ext/standard/tests/strings/stristr_variation2.phpt @@ -57,7 +57,7 @@ foreach($inputs as $input) { try { var_dump( stristr("Hello World", $input) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..e1ec55cfd13b 100644 --- a/ext/standard/tests/strings/strncasecmp_error.phpt +++ b/ext/standard/tests/strings/strncasecmp_error.phpt @@ -12,11 +12,11 @@ $len = -10; try { var_dump( strncasecmp($str1, $str2, $len) ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --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..be6f5b0e6a86 100644 --- a/ext/standard/tests/strings/strncmp_error.phpt +++ b/ext/standard/tests/strings/strncmp_error.phpt @@ -14,10 +14,10 @@ $len = -10; try { var_dump( strncmp($str1, $str2, $len) ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --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..09b4dd75019e 100644 --- a/ext/standard/tests/strings/strpbrk_error.phpt +++ b/ext/standard/tests/strings/strpbrk_error.phpt @@ -8,10 +8,10 @@ echo "-- Testing strpbrk() function with empty second argument --\n"; try { strpbrk($haystack, ''); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + 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..24c0ae85d35f 100644 --- a/ext/standard/tests/strings/strpos.phpt +++ b/ext/standard/tests/strings/strpos.phpt @@ -84,7 +84,7 @@ for( $i = 0; $i < count( $offset_values ); $i++ ) { try { var_dump( strpos($string, "Hello", $offset_values[$i]) ); } catch (TypeError $e) { - echo "\n", $e->getMessage(), "\n"; + echo "\n", $e::class, ': ', $e->getMessage(), "\n"; } } @@ -162,13 +162,13 @@ var_dump( strpos($string, "") ); try { strpos($string, "test", strlen($string)+1); // offset > strlen() } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { strpos($string, "test", -strlen($string)-1); // offset before start } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..e9ef27c6782b 100644 --- a/ext/standard/tests/strings/strripos_offset.phpt +++ b/ext/standard/tests/strings/strripos_offset.phpt @@ -6,39 +6,39 @@ strripos() offset integer overflow try { var_dump(strripos("t", "t", PHP_INT_MAX+1)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { strripos(1024, 1024, -PHP_INT_MAX); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { strripos(1024, "te", -PHP_INT_MAX); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { strripos(1024, 1024, -PHP_INT_MAX-1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { strripos(1024, "te", -PHP_INT_MAX-1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..08a5b35cf094 100644 --- a/ext/standard/tests/strings/strrpos_negative_offset.phpt +++ b/ext/standard/tests/strings/strrpos_negative_offset.phpt @@ -11,7 +11,7 @@ strr[i]pos() function with negative offset try { strrpos("haystack", 'h', -9); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump(strripos("HAYSTHACk", 'ha', -9)); var_dump(strripos("HAYSTACK", 'h', -8)); @@ -22,7 +22,7 @@ strr[i]pos() function with negative offset try { strripos("HAYSTACK", 'h', -9); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..297c61fd219f 100644 --- a/ext/standard/tests/strings/strrpos_offset.phpt +++ b/ext/standard/tests/strings/strrpos_offset.phpt @@ -6,39 +6,39 @@ strrpos() offset integer overflow try { var_dump(strrpos("t", "t", PHP_INT_MAX+1)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { strrpos(1024, 1024, -PHP_INT_MAX); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { strrpos(1024, "te", -PHP_INT_MAX); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { strrpos(1024, 1024, -PHP_INT_MAX-1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { strrpos(1024, "te", -PHP_INT_MAX-1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..f149e6ff0525 100644 --- a/ext/standard/tests/strings/strrpos_variation7.phpt +++ b/ext/standard/tests/strings/strrpos_variation7.phpt @@ -14,7 +14,7 @@ var_dump( strrpos($empty_string, "") ); try { strrpos($empty_string, "", 1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..1bf7ae0bf7e9 100644 --- a/ext/standard/tests/strings/strtr_variation6.phpt +++ b/ext/standard/tests/strings/strtr_variation6.phpt @@ -67,7 +67,7 @@ for($index = 0; $index < count($from_arr); $index++) { try { var_dump(strtr($str, $from, $to)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + 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..759f725c6aaa 100644 --- a/ext/standard/tests/strings/strtr_variation8.phpt +++ b/ext/standard/tests/strings/strtr_variation8.phpt @@ -64,7 +64,7 @@ for($index = 0; $index < count($replace_pairs_arr); $index++) { try { var_dump(strtr($str, $replace_pairs)); } catch (TypeError $e) { - echo $e->getMessage() . "\n"; + 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..21addf6efafe 100644 --- a/ext/standard/tests/strings/strval_error.phpt +++ b/ext/standard/tests/strings/strval_error.phpt @@ -16,7 +16,7 @@ echo "\n-- Testing strval() function with object which has not toString() method try { var_dump( strval(new MyClass()) ); } catch (Error $e) { - echo $e->getMessage(), "\n"; + 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..332fda98c827 100644 --- a/ext/standard/tests/strings/substr_compare.phpt +++ b/ext/standard/tests/strings/substr_compare.phpt @@ -18,7 +18,7 @@ echo "Test\n"; try { substr_compare("abcde", "abc", 0, -1); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + 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..70449f95acda 100644 --- a/ext/standard/tests/strings/substr_count_basic.phpt +++ b/ext/standard/tests/strings/substr_count_basic.phpt @@ -7,12 +7,12 @@ echo "***Testing basic operations ***\n"; try { substr_count("", ""); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { substr_count("a", ""); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + 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..408369173909 100644 --- a/ext/standard/tests/strings/substr_count_error.phpt +++ b/ext/standard/tests/strings/substr_count_error.phpt @@ -10,14 +10,14 @@ $str = 'abcdefghik'; try { substr_count($str, "t", -20); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } /* offset > size of the string */ try { substr_count($str, "t", 25); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } /* Using offset and length to go beyond the size of the string: @@ -25,14 +25,14 @@ try { try { substr_count($str, "i", 5, 7); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } /* length too small */ try { substr_count($str, "t", 2, -20); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..b4778d9dfbcb 100644 --- a/ext/standard/tests/strings/substr_replace_error.phpt +++ b/ext/standard/tests/strings/substr_replace_error.phpt @@ -14,12 +14,12 @@ echo "\n-- Testing substr_replace() function with start and length as arrays but try { var_dump(substr_replace($s1, "evening", array(5))); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(substr_replace($s1, "evening", 5, array(1))); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..a494a18ce109 100644 --- a/ext/standard/tests/strings/unpack_error.phpt +++ b/ext/standard/tests/strings/unpack_error.phpt @@ -6,9 +6,9 @@ Test unpack() function : error conditions try { var_dump(unpack("B", pack("I", 65534))); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + 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..6013e57ca81b 100644 --- a/ext/standard/tests/strings/unpack_offset.phpt +++ b/ext/standard/tests/strings/unpack_offset.phpt @@ -14,16 +14,16 @@ printf("0x%08x 0x%08x\n", try { unpack("l", "foo", 10); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unpack("l", "foo", -1); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + 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..c74ceb37950d 100644 --- a/ext/standard/tests/strings/vfprintf_error1.phpt +++ b/ext/standard/tests/strings/vfprintf_error1.phpt @@ -17,12 +17,12 @@ $extra_arg = 10; try { var_dump( vfprintf( $fp, $format, $args, $extra_arg ) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( vfprintf( $fp, "Foo %d", array(6), "bar" ) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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..b389ec5720cb 100644 --- a/ext/standard/tests/strings/vfprintf_error3.phpt +++ b/ext/standard/tests/strings/vfprintf_error3.phpt @@ -14,19 +14,19 @@ echo "\n-- Testing vfprintf() function with wrong variable types as argument --\ try { vfprintf($fp, array( 'foo %d', 'bar %s' ), 3.55552); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { vfprintf($fp, "Foo: %s", "not available"); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { vfprintf($fp, "Foo %y fake", ["not available"]); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + 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..74c43be68365 100644 --- a/ext/standard/tests/strings/vfprintf_error4.phpt +++ b/ext/standard/tests/strings/vfprintf_error4.phpt @@ -14,12 +14,12 @@ echo "\n-- Testing vfprintf() function with other strangeties --\n"; try { var_dump( vfprintf( 'foo', 'bar', array( 'baz' ) ) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + 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"); + 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..18277b90543b 100644 --- a/ext/standard/tests/strings/vfprintf_variation1.phpt +++ b/ext/standard/tests/strings/vfprintf_variation1.phpt @@ -34,7 +34,7 @@ function writeAndDump($fp, $format, $args) var_dump( $content ); var_dump( $length ); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + 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..5509d29832e3 100644 --- a/ext/standard/tests/strings/vprintf_variation2.phpt +++ b/ext/standard/tests/strings/vprintf_variation2.phpt @@ -84,9 +84,9 @@ foreach($values as $value) { echo "\n"; var_dump($result); } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } catch (\ValueError $e) { - echo $e->getMessage(), "\n"; + 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..c617d8b272f5 100644 --- a/ext/standard/tests/strings/wordwrap.phpt +++ b/ext/standard/tests/strings/wordwrap.phpt @@ -30,7 +30,7 @@ var_dump("123|==1234567890|==123" === wordwrap("123 1234567890 123", 10, "|==", try { wordwrap(chr(0), 0, ""); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + 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..983d1bbe89a8 100644 --- a/ext/standard/tests/strings/wordwrap_error.phpt +++ b/ext/standard/tests/strings/wordwrap_error.phpt @@ -25,7 +25,7 @@ $cut = true; try { wordwrap($str, $width, $break, $cut); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + 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..28d7cee2a4ed 100644 --- a/ext/standard/tests/time/bug60222.phpt +++ b/ext/standard/tests/time/bug60222.phpt @@ -5,15 +5,15 @@ Bug #60222 (time_nanosleep() does validate input params) try { time_nanosleep(-1, 0); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { time_nanosleep(0, -1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..49492c0c98a5 100644 --- a/ext/standard/tests/url/parse_url_error_002.phpt +++ b/ext/standard/tests/url/parse_url_error_002.phpt @@ -12,7 +12,7 @@ echo "\n\n--> Above range:\n"; try { parse_url($url, 99); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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..1e72aafe68fe 100644 --- a/ext/standard/tests/versioning/version_compare_invalid_operator.phpt +++ b/ext/standard/tests/versioning/version_compare_invalid_operator.phpt @@ -7,8 +7,8 @@ David Stockton - - i3logix PHP Testfest 2017 try { version_compare('1.2', '2.1', '??'); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + 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