From 4e26dd0f795f8467196424573b8ce0985930bee8 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Mon, 24 Aug 2026 18:32:11 -0400 Subject: [PATCH 1/7] ext/pdo: Bound-check column index in getColumnMeta() PDOStatement::getColumnMeta() indexed stmt->columns as soon as the driver hook reported success, without checking that the columns had been described or that the index was in range, so pdo_odbc, whose hook always reports success, read out of bounds and crashed. Raise SQLSTATE 07009 and return false instead, matching what the drivers that bound-check the index in their own hook already return. Closes GH-23654 --- NEWS | 4 ++ ext/pdo/pdo_stmt.c | 7 +++ ext/pdo_odbc/tests/getcolumnmeta_bounds.phpt | 49 ++++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 ext/pdo_odbc/tests/getcolumnmeta_bounds.phpt diff --git a/NEWS b/NEWS index 5f598989c660..9a862b7e0e1d 100644 --- a/NEWS +++ b/NEWS @@ -23,6 +23,10 @@ PHP NEWS . Fixed bug GH-23106 (mb_strpos() reads past the end of a haystack ending in a truncated UTF-8 sequence). (Lazizbek Ergashev) +- PDO: + . Fixed PDOStatement::getColumnMeta() reading out of bounds for an invalid + column index. (Ilia Alshanetsky) + - Zip: . Fixed ZipArchive::extractTo() ignoring files given in a non-list array. (David Carlier) diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index 51c2f58c6c2a..8612a01e0444 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -1700,6 +1700,13 @@ PHP_METHOD(PDOStatement, getColumnMeta) RETURN_FALSE; } + if (stmt->columns == NULL || colno >= stmt->column_count) { + zval_ptr_dtor(return_value); + ZVAL_UNDEF(return_value); + pdo_raise_impl_error(stmt->dbh, stmt, "07009", "invalid column index"); + RETURN_FALSE; + } + /* add stock items */ col = &stmt->columns[colno]; add_assoc_str(return_value, "name", zend_string_copy(col->name)); diff --git a/ext/pdo_odbc/tests/getcolumnmeta_bounds.phpt b/ext/pdo_odbc/tests/getcolumnmeta_bounds.phpt new file mode 100644 index 000000000000..192da0903ce6 --- /dev/null +++ b/ext/pdo_odbc/tests/getcolumnmeta_bounds.phpt @@ -0,0 +1,49 @@ +--TEST-- +PDO_odbc getColumnMeta() bounds checking on unexecuted statements and invalid indexes +--EXTENSIONS-- +pdo_odbc +--SKIPIF-- + +--FILE-- + PDO::ERRMODE_EXCEPTION]); +$stmt = $pdo->prepare('SELECT 1 AS one'); + +try { + var_dump($stmt->getColumnMeta(0)); +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; +} + +$stmt->execute(); +var_dump($stmt->getColumnMeta(0)); + +try { + var_dump($stmt->getColumnMeta(5)); +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; +} + +echo "done\n"; +?> +--EXPECTF-- +PDOException: SQLSTATE[07009]: Invalid descriptor index: invalid column index +array(4) { + ["pdo_type"]=> + int(2) + ["name"]=> + string(3) "one" + ["len"]=> + int(%d) + ["precision"]=> + int(%d) +} +PDOException: SQLSTATE[07009]: Invalid descriptor index: invalid column index +done From b06cda0c187200a81c038139e243c8afe1763579 Mon Sep 17 00:00:00 2001 From: Marc Date: Wed, 16 Sep 2026 13:56:41 +0200 Subject: [PATCH 2/7] perf: fix LTO build with gcc (hybrid VM) (#23602) --- Zend/Zend.m4 | 18 ++++++++++++++++++ build/ltmain.sh | 2 ++ 2 files changed, 20 insertions(+) diff --git a/Zend/Zend.m4 b/Zend/Zend.m4 index 41da8344bf1f..6353ea2ec7a8 100644 --- a/Zend/Zend.m4 +++ b/Zend/Zend.m4 @@ -331,6 +331,24 @@ AS_VAR_IF([php_cv_have_global_register_vars], [yes], ]) AC_MSG_CHECKING([whether to enable global register variables support]) AC_MSG_RESULT([$ZEND_GCC_GLOBAL_REGS]) + +dnl GCC doesn't propagate -ffixed-* from LTO objects. Reserve the VM registers +dnl before LTO code gen to avoid "global register variable follows a function definition" +AS_VAR_IF([ZEND_GCC_GLOBAL_REGS], [yes], [ + zend_lto=no + for zend_flag in $CC $CFLAGS $LDFLAGS; do + AS_CASE([$zend_flag], [-flto|-flto=*], [zend_lto=yes], [-fno-lto], [zend_lto=no]) + done + AS_VAR_IF([zend_lto], [yes], [ + AS_CASE([$host_cpu], + [x86_64*|amd64*], [AS_VAR_APPEND([LDFLAGS], [" -ffixed-r14 -ffixed-r15"])], + [x86*|amd*|i?86*|pentium], [AS_VAR_APPEND([LDFLAGS], [" -ffixed-esi -ffixed-edi"])], + [aarch64*|arm64*], [AS_VAR_APPEND([LDFLAGS], [" -ffixed-x27 -ffixed-x28"])], + [ppc64*|powerpc64*], [AS_VAR_APPEND([LDFLAGS], [" -ffixed-r14 -ffixed-r15"])], + [riscv64*], [AS_VAR_APPEND([LDFLAGS], [" -ffixed-x18 -ffixed-x19"])], + [AC_MSG_ERROR([Cannot reserve VM registers for LTO, disable LTO or use --disable-gcc-global-regs])]) + ]) +]) ]) dnl diff --git a/build/ltmain.sh b/build/ltmain.sh index 3e6a3db3a5a1..c299766165bc 100755 --- a/build/ltmain.sh +++ b/build/ltmain.sh @@ -7705,6 +7705,7 @@ func_mode_link () # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + # -ffixed-*, -fno-lto GCC LTO register reservations and cancellation # -specs=* GCC specs files # -stdlib=* select c++ std lib with clang # -fdiagnostics-color* simply affects output @@ -7725,6 +7726,7 @@ func_mode_link () -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-no-canonical-prefixes| \ + -ffixed-*|-fno-lto| \ -stdlib=*|-rtlib=*|--unwindlib=*| \ -specs=*|-fsanitize=*|-fno-sanitize*|-shared-libsan|-static-libsan| \ -ffile-prefix-map=*|-fdebug-prefix-map=*|-fmacro-prefix-map=*|-fprofile-prefix-map=*| \ From f05fc31c644d5d9d517d5795d8fc36484fc08303 Mon Sep 17 00:00:00 2001 From: NickSdot <32384907+NickSdot@users.noreply.github.com> Date: Wed, 16 Sep 2026 19:42:53 +0700 Subject: [PATCH 3/7] ext/standard: Removes ZPP style tests (#23413) We don't test ZPP for each individual function as this is global behaviour. --- ...rray_column_scalar_index_strict_types.phpt | 63 ----- .../array_column_scalar_index_weak_types.phpt | 81 ------- ext/standard/tests/array/array_diff_1.phpt | 19 -- .../array/array_diff_key_variation1.phpt | 207 ----------------- .../array/array_diff_key_variation2.phpt | 208 ----------------- .../tests/array/array_diff_uassoc_error.phpt | 52 ----- .../array/array_diff_uassoc_variation1.phpt | 188 --------------- .../array/array_diff_uassoc_variation2.phpt | 188 --------------- .../array/array_diff_ukey_variation1.phpt | 215 ----------------- .../array/array_diff_ukey_variation10.phpt | 29 --- .../array/array_diff_ukey_variation2.phpt | 219 ------------------ .../array_intersect_assoc_variation1.phpt | 187 --------------- .../array_intersect_assoc_variation2.phpt | 188 --------------- .../array/array_intersect_key_variation1.phpt | 211 ----------------- .../array/array_intersect_key_variation2.phpt | 212 ----------------- .../array_intersect_uassoc_variation1.phpt | 219 ------------------ .../array_intersect_uassoc_variation2.phpt | 219 ------------------ .../array_intersect_ukey_variation1.phpt | 217 ----------------- .../array_intersect_ukey_variation2.phpt | 217 ----------------- .../array_intersect_ukey_variation8.phpt | 29 --- .../array/array_intersect_variation1.phpt | 187 --------------- .../array/array_intersect_variation2.phpt | 188 --------------- .../tests/array/array_map_object1.phpt | 186 --------------- .../tests/array/array_map_object2.phpt | 45 ---- .../tests/array/array_map_variation15.phpt | 27 --- .../tests/array/array_map_variation17.phpt | 137 ----------- .../array_merge_recursive_variation1.phpt | 210 ----------------- .../array_merge_recursive_variation2.phpt | 150 ------------ .../tests/array/array_merge_variation1.phpt | 104 --------- .../tests/array/array_merge_variation2.phpt | 181 --------------- .../array/array_udiff_assoc_variation1.phpt | 173 -------------- .../array/array_udiff_assoc_variation2.phpt | 173 -------------- .../array/array_udiff_uassoc_variation1.phpt | 174 -------------- .../array/array_udiff_uassoc_variation2.phpt | 174 -------------- .../tests/array/array_udiff_variation1.phpt | 173 -------------- .../tests/array/array_udiff_variation2.phpt | 173 -------------- .../array_uintersect_assoc_variation1.phpt | 173 -------------- .../array_uintersect_assoc_variation2.phpt | 173 -------------- .../array_uintersect_uassoc_variation1.phpt | 174 -------------- .../array_uintersect_uassoc_variation2.phpt | 174 -------------- .../array/array_uintersect_variation1.phpt | 173 -------------- .../array/array_uintersect_variation2.phpt | 173 -------------- .../class_object/get_class_variation_001.phpt | 158 ------------- .../class_object/property_exists_error.phpt | 21 -- .../escapeshellarg_variation1-win32.phpt | 107 --------- .../escapeshellarg_variation1.phpt | 106 --------- ext/standard/tests/math/abs_variation.phpt | 138 ----------- ext/standard/tests/math/ceil_variation1.phpt | 131 ----------- ext/standard/tests/math/floor_variation1.phpt | 131 ----------- ext/standard/tests/math/round_variation1.phpt | 175 -------------- .../tests/password/password_hash_error.phpt | 43 ---- .../password/password_needs_rehash_error.phpt | 37 --- .../tests/password/password_verify_error.phpt | 15 -- ext/standard/tests/strings/join_error1.phpt | 149 ------------ .../tests/strings/join_variation1.phpt | 133 ----------- .../tests/strings/sprintf_variation1.phpt | 213 ----------------- .../tests/strings/vprintf_variation2.phpt | 168 -------------- 57 files changed, 8388 deletions(-) delete mode 100644 ext/standard/tests/array/array_column_scalar_index_strict_types.phpt delete mode 100644 ext/standard/tests/array/array_column_scalar_index_weak_types.phpt delete mode 100644 ext/standard/tests/array/array_diff_1.phpt delete mode 100644 ext/standard/tests/array/array_diff_key_variation1.phpt delete mode 100644 ext/standard/tests/array/array_diff_key_variation2.phpt delete mode 100644 ext/standard/tests/array/array_diff_uassoc_error.phpt delete mode 100644 ext/standard/tests/array/array_diff_uassoc_variation1.phpt delete mode 100644 ext/standard/tests/array/array_diff_uassoc_variation2.phpt delete mode 100644 ext/standard/tests/array/array_diff_ukey_variation1.phpt delete mode 100644 ext/standard/tests/array/array_diff_ukey_variation10.phpt delete mode 100644 ext/standard/tests/array/array_diff_ukey_variation2.phpt delete mode 100644 ext/standard/tests/array/array_intersect_assoc_variation1.phpt delete mode 100644 ext/standard/tests/array/array_intersect_assoc_variation2.phpt delete mode 100644 ext/standard/tests/array/array_intersect_key_variation1.phpt delete mode 100644 ext/standard/tests/array/array_intersect_key_variation2.phpt delete mode 100644 ext/standard/tests/array/array_intersect_uassoc_variation1.phpt delete mode 100644 ext/standard/tests/array/array_intersect_uassoc_variation2.phpt delete mode 100644 ext/standard/tests/array/array_intersect_ukey_variation1.phpt delete mode 100644 ext/standard/tests/array/array_intersect_ukey_variation2.phpt delete mode 100644 ext/standard/tests/array/array_intersect_ukey_variation8.phpt delete mode 100644 ext/standard/tests/array/array_intersect_variation1.phpt delete mode 100644 ext/standard/tests/array/array_intersect_variation2.phpt delete mode 100644 ext/standard/tests/array/array_map_object1.phpt delete mode 100644 ext/standard/tests/array/array_map_object2.phpt delete mode 100644 ext/standard/tests/array/array_map_variation15.phpt delete mode 100644 ext/standard/tests/array/array_map_variation17.phpt delete mode 100644 ext/standard/tests/array/array_merge_recursive_variation1.phpt delete mode 100644 ext/standard/tests/array/array_merge_recursive_variation2.phpt delete mode 100644 ext/standard/tests/array/array_merge_variation1.phpt delete mode 100644 ext/standard/tests/array/array_merge_variation2.phpt delete mode 100644 ext/standard/tests/array/array_udiff_assoc_variation1.phpt delete mode 100644 ext/standard/tests/array/array_udiff_assoc_variation2.phpt delete mode 100644 ext/standard/tests/array/array_udiff_uassoc_variation1.phpt delete mode 100644 ext/standard/tests/array/array_udiff_uassoc_variation2.phpt delete mode 100644 ext/standard/tests/array/array_udiff_variation1.phpt delete mode 100644 ext/standard/tests/array/array_udiff_variation2.phpt delete mode 100644 ext/standard/tests/array/array_uintersect_assoc_variation1.phpt delete mode 100644 ext/standard/tests/array/array_uintersect_assoc_variation2.phpt delete mode 100644 ext/standard/tests/array/array_uintersect_uassoc_variation1.phpt delete mode 100644 ext/standard/tests/array/array_uintersect_uassoc_variation2.phpt delete mode 100644 ext/standard/tests/array/array_uintersect_variation1.phpt delete mode 100644 ext/standard/tests/array/array_uintersect_variation2.phpt delete mode 100644 ext/standard/tests/class_object/get_class_variation_001.phpt delete mode 100644 ext/standard/tests/class_object/property_exists_error.phpt delete mode 100644 ext/standard/tests/general_functions/escapeshellarg_variation1-win32.phpt delete mode 100644 ext/standard/tests/general_functions/escapeshellarg_variation1.phpt delete mode 100644 ext/standard/tests/math/abs_variation.phpt delete mode 100644 ext/standard/tests/math/ceil_variation1.phpt delete mode 100644 ext/standard/tests/math/floor_variation1.phpt delete mode 100644 ext/standard/tests/math/round_variation1.phpt delete mode 100644 ext/standard/tests/password/password_hash_error.phpt delete mode 100644 ext/standard/tests/password/password_needs_rehash_error.phpt delete mode 100644 ext/standard/tests/password/password_verify_error.phpt delete mode 100644 ext/standard/tests/strings/join_error1.phpt delete mode 100644 ext/standard/tests/strings/join_variation1.phpt delete mode 100644 ext/standard/tests/strings/sprintf_variation1.phpt delete mode 100644 ext/standard/tests/strings/vprintf_variation2.phpt 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 deleted file mode 100644 index 322cd1f0ab0b..000000000000 --- a/ext/standard/tests/array/array_column_scalar_index_strict_types.phpt +++ /dev/null @@ -1,63 +0,0 @@ ---TEST-- -Test array_column(): Index argument with various types in strict type mode ---FILE-- -getMessage() . "\n"; -} -try { - var_dump(array_column([['php7', 'foo'], ['php8', 'bar']], true)); -} catch (\TypeError $e) { - echo $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 "\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"; -} -try { - var_dump(array_column([['php' => 7, 'foo'], ['php' => 8, 'bar']], 'php', true)); -} catch (\TypeError $e) { - echo $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"; -} - -?> - -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 - --- 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 - --- 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 - --- 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 - -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 deleted file mode 100644 index 42ca676ebfca..000000000000 --- a/ext/standard/tests/array/array_column_scalar_index_weak_types.phpt +++ /dev/null @@ -1,81 +0,0 @@ ---TEST-- -Test array_column(): Index argument with various types in weak type mode ---FILE-- -getMessage() . "\n"; -} -try { - var_dump(array_column([['php7', 'foo'], ['php8', 'bar']], true)); -} catch (\TypeError $e) { - echo $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 "\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"; -} -try { - var_dump(array_column([['php' => 7, 'foo'], ['php' => 8, 'bar']], 'php', true)); -} catch (\TypeError $e) { - echo $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"; -} - -?> - -DONE ---EXPECT-- --- Testing array_column() column key parameter should be a string or an integer (testing bool) -- -array(2) { - [0]=> - string(4) "php7" - [1]=> - string(4) "php8" -} -array(2) { - [0]=> - string(3) "foo" - [1]=> - string(3) "bar" -} - --- 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 - --- Testing array_column() index key parameter should be a string or an integer (testing bool) -- -array(2) { - ["foo"]=> - int(7) - ["bar"]=> - int(8) -} -array(2) { - [0]=> - int(7) - [1]=> - int(8) -} - --- 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 - -DONE diff --git a/ext/standard/tests/array/array_diff_1.phpt b/ext/standard/tests/array/array_diff_1.phpt deleted file mode 100644 index 7b58077e95af..000000000000 --- a/ext/standard/tests/array/array_diff_1.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Test array_diff when non-array is passed ---FILE-- -getMessage(), "\n"; -} -//-=-=-=-=-=- -echo "OK!"; -?> ---EXPECT-- -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 deleted file mode 100644 index 7b422153a0a0..000000000000 --- a/ext/standard/tests/array/array_diff_key_variation1.phpt +++ /dev/null @@ -1,207 +0,0 @@ ---TEST-- -Test array_diff_key() function : usage variation - Passing unexpected values to first argument ---FILE-- - 5, 'blue' => 6, 'yellow' => 7, 'cyan' => 8); -$array3 = array(1, 2, 3, 4, 5); - -//get an unset variable -$unset_var = 10; -unset ($unset_var); - -//resource variable -$fp = fopen(__FILE__, "r"); - -// define some classes -class classWithToString -{ - public function __toString() { - return "Class A object"; - } -} - -class classWithoutToString -{ -} - -// heredoc string -$heredoc = << 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -12345, - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, - - // resource data - 'resource' => $fp, -); - -// loop through each element of the array for array1 -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - try { - var_dump( array_diff_key($value, $array2) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } - try { - var_dump( array_diff_key($value, $array2, $array3) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } -}; - -fclose($fp); -?> ---EXPECT-- -*** 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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 diff --git a/ext/standard/tests/array/array_diff_key_variation2.phpt b/ext/standard/tests/array/array_diff_key_variation2.phpt deleted file mode 100644 index b7093606c60a..000000000000 --- a/ext/standard/tests/array/array_diff_key_variation2.phpt +++ /dev/null @@ -1,208 +0,0 @@ ---TEST-- -Test array_diff_key() function : usage variation - Passing unexpected values to second argument ---FILE-- - 5, 'blue' => 6, 'yellow' => 7, 'cyan' => 8); -$array3 = array(1, 2, 3, 4, 5); - -//get an unset variable -$unset_var = 10; -unset ($unset_var); - -//resource variable -$fp = fopen(__FILE__, "r"); - -// define some classes -class classWithToString -{ - public function __toString() { - return "Class A object"; - } -} - -class classWithoutToString -{ -} - -// heredoc string -$heredoc = << 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -12345, - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, - - // resource data - 'resource' => $fp, -); - -// loop through each element of the array for array1 - -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - try { - var_dump( array_diff_key($array1, $value) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } - try { - var_dump( array_diff_key($array1, $value, $array3) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } -}; - -fclose($fp); -?> ---EXPECT-- -*** 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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 diff --git a/ext/standard/tests/array/array_diff_uassoc_error.phpt b/ext/standard/tests/array/array_diff_uassoc_error.phpt deleted file mode 100644 index 1d158dc2d49c..000000000000 --- a/ext/standard/tests/array/array_diff_uassoc_error.phpt +++ /dev/null @@ -1,52 +0,0 @@ ---TEST-- -Test array_diff_uassoc() function : error conditions ---FILE-- - "green", "b" => "brown", "c" => "blue", "red"); -$array2 = array("a" => "green", "yellow", "red"); -$array3 = array("a" => "green", "red"); -$array4 = array(); -$extra_arg = array(1, 2, 3, 4); - -function key_compare_func($a, $b) -{ - if ($a === $b) { - return 0; - } - return ($a > $b)? 1:-1; -} - -//Test array_diff_uassoc with one more than the expected number of arguments -echo "\n-- Testing array_diff_uassoc() function with more than expected no. of arguments --\n"; -try { - var_dump( array_diff_uassoc($array1, $array2, "key_compare_func", $extra_arg) ); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; -} -try { - var_dump( array_diff_uassoc($array1, $array2, $array3, $array4, "key_compare_func", $extra_arg) ); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; -} - -// Testing array_diff_uassoc with one less than the expected number of arguments -echo "\n-- Testing array_diff_uassoc() function with less than expected no. of arguments --\n"; -try { - var_dump( array_diff_uassoc($array1, $array2) ); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; -} - -?> ---EXPECT-- -*** 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 - --- 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 diff --git a/ext/standard/tests/array/array_diff_uassoc_variation1.phpt b/ext/standard/tests/array/array_diff_uassoc_variation1.phpt deleted file mode 100644 index 49d6903a90ea..000000000000 --- a/ext/standard/tests/array/array_diff_uassoc_variation1.phpt +++ /dev/null @@ -1,188 +0,0 @@ ---TEST-- -Test array_diff_uassoc() function : usage variation - Passing unexpected values to first argument ---FILE-- - "green", "yellow", "red"); - -function key_compare_func($a, $b) -{ - if ($a === $b) { - return 0; - } - return ($a > $b)? 1:-1; -} - -//get an unset variable -$unset_var = 10; -unset ($unset_var); - -//resource variable -$fp = fopen(__FILE__, "r"); - -// define some classes -class classWithToString -{ - public function __toString() { - return "Class A object"; - } -} - -class classWithoutToString -{ -} - -// heredoc string -$heredoc = << 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // int data - 'int 0' => 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -2345, - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, - - // resource data - 'resource' => $fp, -); - -// loop through each element of the array for array1 - -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - try { - var_dump( array_diff_uassoc($value, $array2, "key_compare_func") ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } -}; - -fclose($fp); -?> ---EXPECT-- -*** Testing array_diff_uassoc() : usage variation *** - ---int 0-- -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 - ---int 12345-- -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 - ---float 10.5-- -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 - ---float 12.3456789000e10-- -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 - ---float .5-- -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 - ---lowercase null-- -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 - ---lowercase false-- -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 - ---uppercase FALSE-- -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 - ---empty string SQ-- -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 - ---string SQ-- -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 - ---heredoc-- -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 - ---instance of classWithoutToString-- -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 - ---unset var-- -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 diff --git a/ext/standard/tests/array/array_diff_uassoc_variation2.phpt b/ext/standard/tests/array/array_diff_uassoc_variation2.phpt deleted file mode 100644 index 7466da23d426..000000000000 --- a/ext/standard/tests/array/array_diff_uassoc_variation2.phpt +++ /dev/null @@ -1,188 +0,0 @@ ---TEST-- -Test array_diff_uassoc() function : usage variation -Passing unexpected values to second argument ---FILE-- - "green", "b" => "brown", "c" => "blue", "red"); - -function key_compare_func($a, $b) -{ - if ($a === $b) { - return 0; - } - return ($a > $b)? 1:-1; -} - -//get an unset variable -$unset_var = 10; -unset ($unset_var); - -//resource variable -$fp = fopen(__FILE__, "r"); - -// define some classes -class classWithToString -{ - public function __toString() { - return "Class A object"; - } -} - -class classWithoutToString -{ -} - -// heredoc string -$heredoc = << 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // int data - 'int 0' => 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -2345, - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, - - // resource data - 'resource' => $fp, -); - -// loop through each element of the array for array2 - -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - try { - var_dump( array_diff_uassoc($array1, $value, "key_compare_func") ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } -}; - -fclose($fp); -?> ---EXPECT-- -*** Testing array_diff_uassoc() : usage variation *** - ---int 0-- -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 - ---int 12345-- -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 - ---float 10.5-- -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 - ---float 12.3456789000e10-- -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 - ---float .5-- -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 - ---lowercase null-- -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 - ---lowercase false-- -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 - ---uppercase FALSE-- -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 - ---empty string SQ-- -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 - ---string SQ-- -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 - ---heredoc-- -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 - ---instance of classWithoutToString-- -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 - ---unset var-- -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 diff --git a/ext/standard/tests/array/array_diff_ukey_variation1.phpt b/ext/standard/tests/array/array_diff_ukey_variation1.phpt deleted file mode 100644 index 125406497eda..000000000000 --- a/ext/standard/tests/array/array_diff_ukey_variation1.phpt +++ /dev/null @@ -1,215 +0,0 @@ ---TEST-- -Test array_diff_ukey() function : usage variation - Passing unexpected values to first argument ---FILE-- - 5, 'blue' => 6, 'yellow' => 7, 'cyan' => 8); -$array3 = array('blue' => 1, 'red' => 2, 'green' => 3, 'purple' => 4); - -function key_compare_func($key1, $key2) -{ - if ($key1 == $key2) { - return 0; - } - return ($key1 > $key2)? 1:-1; -} - -//get an unset variable -$unset_var = 10; -unset ($unset_var); - -//resource variable -$fp = fopen(__FILE__, "r"); - -// define some classes -class classWithToString -{ - public function __toString() { - return "Class A object"; - } -} - -class classWithoutToString -{ -} - -// heredoc string -$heredoc = << 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -2345, - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, - - // resource data - 'resource' => $fp, -); - -// loop through each element of the array for array1 -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - try { - var_dump( array_diff_ukey($value, $array2, 'key_compare_func') ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } - try { - var_dump( array_diff_ukey($value, $array2, $array3, 'key_compare_func') ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } -}; - -fclose($fp); -?> ---EXPECT-- -*** 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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 diff --git a/ext/standard/tests/array/array_diff_ukey_variation10.phpt b/ext/standard/tests/array/array_diff_ukey_variation10.phpt deleted file mode 100644 index b8dfb73873bb..000000000000 --- a/ext/standard/tests/array/array_diff_ukey_variation10.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -Test array_diff_ukey() function : usage variation - Passing non-existing function name to callback ---FILE-- - "green", "b" => "brown", "c" => "blue", "red"); -$array2 = array("a" => "green", "yellow", "red"); - -//function name within double quotes -try { - var_dump( array_diff_ukey($array1, $array1, "unknown_function") ); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; -} - -//function name within single quotes -try { - var_dump( array_diff_ukey($array1, $array1, 'unknown_function') ); -} catch (TypeError $e) { - echo $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 diff --git a/ext/standard/tests/array/array_diff_ukey_variation2.phpt b/ext/standard/tests/array/array_diff_ukey_variation2.phpt deleted file mode 100644 index cf71a26d22be..000000000000 --- a/ext/standard/tests/array/array_diff_ukey_variation2.phpt +++ /dev/null @@ -1,219 +0,0 @@ ---TEST-- -Test array_diff_ukey() function : usage variation - Passing unexpected values to second argument ---FILE-- - 5, 'blue' => 6, 'yellow' => 7, 'cyan' => 8); -$array3 = array('blue' => 1, 'red' => 2, 'green' => 3, 'purple' => 4); - - -//Initialize key_comp_func of type callback -function key_compare_func($key1, $key2) -{ - if ($key1 == $key2) { - return 0; - } - return ($key1 > $key2)? 1:-1; -} - -//get an unset variable -$unset_var = 10; -unset ($unset_var); - -//resource variable -$fp = fopen(__FILE__, "r"); - -// define some classes -class classWithToString -{ - public function __toString() { - return "Class A object"; - } -} - -class classWithoutToString -{ -} - -// heredoc string -$heredoc = << 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -2345, - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, - - // resource data - 'resource' => $fp, - -); - -// loop through each element of the array for array2 - -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - try { - var_dump( array_diff_ukey($array1, $value, 'key_compare_func') ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } - try { - var_dump( array_diff_ukey($array1, $value, $array3, 'key_compare_func') ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } -}; - -fclose($fp); -?> ---EXPECT-- -*** 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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 diff --git a/ext/standard/tests/array/array_intersect_assoc_variation1.phpt b/ext/standard/tests/array/array_intersect_assoc_variation1.phpt deleted file mode 100644 index 9c9cef73dd1f..000000000000 --- a/ext/standard/tests/array/array_intersect_assoc_variation1.phpt +++ /dev/null @@ -1,187 +0,0 @@ ---TEST-- -Test array_intersect_assoc() function : usage variations - unexpected values for 'array1' argument(Bug#43196) ---FILE-- - 1, "two" => 2); - -// get an unset variable -$unset_var = 10; -unset ($unset_var); - -// get a class -class classA -{ - public function __toString() { - return "Class A object"; - } -} - -// heredoc string -$heredoc = <<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"; - } - $iterator++; -} - -// close the file resource used -fclose($fp); - -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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 -Done diff --git a/ext/standard/tests/array/array_intersect_assoc_variation2.phpt b/ext/standard/tests/array/array_intersect_assoc_variation2.phpt deleted file mode 100644 index 31b54469863a..000000000000 --- a/ext/standard/tests/array/array_intersect_assoc_variation2.phpt +++ /dev/null @@ -1,188 +0,0 @@ ---TEST-- -Test array_intersect_assoc() function : usage variations - unexpected values for 'array2' argument(Bug#43196) ---FILE-- - 1, "two" => 2); - -// get an unset variable -$unset_var = 10; -unset ($unset_var); - -// get a class -class classA -{ - public function __toString() { - return "Class A object"; - } -} - -// heredoc string -$heredoc = <<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"; - } - - $iterator++; -} - -// close the file resource used -fclose($fp); - -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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 -Done diff --git a/ext/standard/tests/array/array_intersect_key_variation1.phpt b/ext/standard/tests/array/array_intersect_key_variation1.phpt deleted file mode 100644 index ae11e0a2ec93..000000000000 --- a/ext/standard/tests/array/array_intersect_key_variation1.phpt +++ /dev/null @@ -1,211 +0,0 @@ ---TEST-- -Test array_intersect_key() function : usage variation - Passing unexpected values to first argument ---FILE-- - 1, 'red' => 2, 'green' => 3, 'purple' => 4); -$array3 = array('green' => 5, 'blue' => 6, 'yellow' => 7, 'cyan' => 8); - -//get an unset variable -$unset_var = 10; -unset ($unset_var); - -//resource variable -$fp = fopen(__FILE__, "r"); - -// define some classes -class classWithToString -{ - public function __toString() { - return "Class A object"; - } -} - -class classWithoutToString -{ -} - -// heredoc string -$heredoc = << 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // int data - 'int 0' => 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -12345, - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, - - // resource data - 'resource var' => $fp, -); - -// loop through each element of the array for array1 -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - try { - var_dump( array_intersect_key($value, $array2) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } - try { - var_dump( array_intersect_key($value, $array2, $array3) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } -} - -fclose($fp); -?> ---EXPECT-- -*** 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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 diff --git a/ext/standard/tests/array/array_intersect_key_variation2.phpt b/ext/standard/tests/array/array_intersect_key_variation2.phpt deleted file mode 100644 index d2a8672e284c..000000000000 --- a/ext/standard/tests/array/array_intersect_key_variation2.phpt +++ /dev/null @@ -1,212 +0,0 @@ ---TEST-- -Test array_intersect_key() function : usage variation - Passing unexpected values to second argument ---FILE-- - 1, 'red' => 2, 'green' => 3, 'purple' => 4); -$array3 = array('green' => 5, 'blue' => 6, 'yellow' => 7, 'cyan' => 8); - -//get an unset variable -$unset_var = 10; -unset ($unset_var); - -//resource variable -$fp = fopen(__FILE__, "r"); - -// define some classes -class classWithToString -{ - public function __toString() { - return "Class A object"; - } -} - -class classWithoutToString -{ -} - -// heredoc string -$heredoc = << 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // int data - 'int 0' => 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -12345, - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, - - // resource data - 'resource var' => $fp, -); - -// loop through each element of the array for array2 - -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - try { - var_dump( array_intersect_key($array1, $value) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } - try { - var_dump( array_intersect_key($array1, $value, $array3) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } -} - -fclose($fp); -?> ---EXPECT-- -*** 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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 diff --git a/ext/standard/tests/array/array_intersect_uassoc_variation1.phpt b/ext/standard/tests/array/array_intersect_uassoc_variation1.phpt deleted file mode 100644 index ea6ce6a1a5a1..000000000000 --- a/ext/standard/tests/array/array_intersect_uassoc_variation1.phpt +++ /dev/null @@ -1,219 +0,0 @@ ---TEST-- -Test array_intersect_uassoc() function : usage variation - Passing unexpected values to first argument ---FILE-- - "green", "yellow", "red"); -$array3 = array("a"=>"green", "brown"); - -//Callback function -function key_compare_func($a, $b) { - if ($a === $b) { - return 0; - } - return ($a > $b) ? 1 : -1; -} - -//get an unset variable -$unset_var = 10; -unset ($unset_var); - -//resource variable -$fp = fopen(__FILE__, "r"); - -// define some classes -class classWithToString -{ - public function __toString() { - return "Class A object"; - } -} - -class classWithoutToString -{ -} - -// heredoc string -$heredoc = << 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // int data - 'int 0' => 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -12345, - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, - - // resource data - 'resource' => $fp, -); - -// loop through each element of the array for array1 -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - try { - var_dump( array_intersect_uassoc($value, $array2, 'key_compare_func') ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } - try { - var_dump( array_intersect_uassoc($value, $array2, $array3, 'key_compare_func') ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } -}; - -fclose($fp); -?> ---EXPECT-- -*** 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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 diff --git a/ext/standard/tests/array/array_intersect_uassoc_variation2.phpt b/ext/standard/tests/array/array_intersect_uassoc_variation2.phpt deleted file mode 100644 index 03a7dc8d07e5..000000000000 --- a/ext/standard/tests/array/array_intersect_uassoc_variation2.phpt +++ /dev/null @@ -1,219 +0,0 @@ ---TEST-- -Test array_intersect_uassoc() function : usage variation - Passing unexpected values to second argument ---FILE-- - "green", "b" => "brown", "c" => "blue", "red"); -$array3 = array("a"=>"green", "brown"); - -//Callback function -function key_compare_func($a, $b) { - if ($a === $b) { - return 0; - } - return ($a > $b) ? 1 : -1; -} - -//get an unset variable -$unset_var = 10; -unset ($unset_var); - -//resource variable -$fp = fopen(__FILE__, "r"); - -// define some classes -class classWithToString -{ - public function __toString() { - return "Class A object"; - } -} - -class classWithoutToString -{ -} - -// heredoc string -$heredoc = << 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // int data - 'int 0' => 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -12345, - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, - - // resource data - 'resource' => $fp, -); - -// loop through each element of the array for array1 -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - try { - var_dump( array_intersect_uassoc($array1, $value, 'key_compare_func') ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } - try { - var_dump( array_intersect_uassoc($array1, $value, $array3, 'key_compare_func') ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } -}; - -fclose($fp); -?> ---EXPECT-- -*** 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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 diff --git a/ext/standard/tests/array/array_intersect_ukey_variation1.phpt b/ext/standard/tests/array/array_intersect_ukey_variation1.phpt deleted file mode 100644 index 8195d45c294e..000000000000 --- a/ext/standard/tests/array/array_intersect_ukey_variation1.phpt +++ /dev/null @@ -1,217 +0,0 @@ ---TEST-- -Test array_intersect_ukey() function : usage variation - Passing unexpected values to first argument ---FILE-- - 5, 'blue' => 6, 'yellow' => 7, 'cyan' => 8); -$array3 = array('green' => 5, 'cyan' => 8); - -//Call back function -function key_compare_func($key1, $key2) -{ - if ($key1 == $key2) - return 0; - else - return ($key1 > $key2)? 1:-1; -} - -//get an unset variable -$unset_var = 10; -unset ($unset_var); - -//resource variable -$fp = fopen(__FILE__, "r"); - -// define some classes -class classWithToString -{ - public function __toString() { - return "Class A object"; - } -} - -class classWithoutToString -{ -} - -// heredoc string -$heredoc = << 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -12345, - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, - - // resource data - 'resource var' => $fp, -); - -// loop through each element of the array for array1 - -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - try { - var_dump( array_intersect_ukey($value, $array2, 'key_compare_func') ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } - try { - var_dump( array_intersect_ukey($value, $array2, $array3, 'key_compare_func') ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } -}; - -fclose($fp); -?> ---EXPECT-- -*** 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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 diff --git a/ext/standard/tests/array/array_intersect_ukey_variation2.phpt b/ext/standard/tests/array/array_intersect_ukey_variation2.phpt deleted file mode 100644 index d32c0632ca5e..000000000000 --- a/ext/standard/tests/array/array_intersect_ukey_variation2.phpt +++ /dev/null @@ -1,217 +0,0 @@ ---TEST-- -Test array_intersect_ukey() function : usage variation - Passing unexpected values to second argument ---FILE-- - 1, 'red' => 2, 'green' => 3, 'purple' => 4); -$array3 = array('green' => 5, 'cyan' => 8); - -//Call back function -function key_compare_func($key1, $key2) -{ - if ($key1 == $key2) - return 0; - else - return ($key1 > $key2)? 1:-1; -} - -//get an unset variable -$unset_var = 10; -unset ($unset_var); - -//resource variable -$fp = fopen(__FILE__, "r"); - -// define some classes -class classWithToString -{ - public function __toString() { - return "Class A object"; - } -} - -class classWithoutToString -{ -} - -// heredoc string -$heredoc = << 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -12345, - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, - - // resource data - 'resource var' => $fp, -); - -// loop through each element of the array for array2 - -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - try { - var_dump( array_intersect_ukey($array1, $value, 'key_compare_func') ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } - try { - var_dump( array_intersect_ukey($array1, $value, $array3, 'key_compare_func') ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } -}; - -fclose($fp); -?> ---EXPECT-- -*** 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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 - ---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 diff --git a/ext/standard/tests/array/array_intersect_ukey_variation8.phpt b/ext/standard/tests/array/array_intersect_ukey_variation8.phpt deleted file mode 100644 index 71126a1eddfa..000000000000 --- a/ext/standard/tests/array/array_intersect_ukey_variation8.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -Test array_intersect_ukey() function : usage variation - Passing non-existing function name to callback ---FILE-- - 1, 'red' => 2, 'green' => 3, 'purple' => 4); -$array2 = array('green' => 5, 'blue' => 6, 'yellow' => 7, 'cyan' => 8); - -//function name within double quotes -try { - var_dump( array_intersect_ukey($array1, $array2, "unknown_function") ); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; -} - -//function name within single quotes -try { - var_dump( array_intersect_ukey($array1, $array2, 'unknown_function') ); -} catch (TypeError $e) { - echo $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 diff --git a/ext/standard/tests/array/array_intersect_variation1.phpt b/ext/standard/tests/array/array_intersect_variation1.phpt deleted file mode 100644 index 733250b69f70..000000000000 --- a/ext/standard/tests/array/array_intersect_variation1.phpt +++ /dev/null @@ -1,187 +0,0 @@ ---TEST-- -Test array_intersect() function : usage variations - unexpected values for 'array1' argument ---FILE-- - 1, "two" => 2); - -// get an unset variable -$unset_var = 10; -unset ($unset_var); - -// get a class -class classA -{ - public function __toString() { - return "Class A object"; - } -} - -// heredoc string -$heredoc = <<getMessage(), "\n"; - } - - // Calling array_intersect() with more arguments - try { - var_dump( array_intersect($unexpected_value, $array2, $arr3) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } - $iterator++; -} - -// close the file resource used -fclose($fp); - -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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 -Done diff --git a/ext/standard/tests/array/array_intersect_variation2.phpt b/ext/standard/tests/array/array_intersect_variation2.phpt deleted file mode 100644 index b09683446b87..000000000000 --- a/ext/standard/tests/array/array_intersect_variation2.phpt +++ /dev/null @@ -1,188 +0,0 @@ ---TEST-- -Test array_intersect() function : usage variations - unexpected values for 'array2' argument ---FILE-- - 1, "two" => 2); - -// get an unset variable -$unset_var = 10; -unset ($unset_var); - -// get a class -class classA -{ - public function __toString() { - return "Class A object"; - } -} - -// heredoc string -$heredoc = <<getMessage(), "\n"; - } - - // Calling array_intersect() with more arguments - try { - var_dump( array_intersect($array1, $unexpected_value, $arr3) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } - - $iterator++; -} - -// close the file resource used -fclose($fp); - -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 2 --array_intersect(): Argument #2 must be of type array, int given -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 4 --array_intersect(): Argument #2 must be of type array, int given -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 6 --array_intersect(): Argument #2 must be of type array, float given -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 8 --array_intersect(): Argument #2 must be of type array, float given -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 10 --array_intersect(): Argument #2 must be of type array, null given -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 12 --array_intersect(): Argument #2 must be of type array, true given -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 14 --array_intersect(): Argument #2 must be of type array, true given -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 16 --array_intersect(): Argument #2 must be of type array, string given -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 18 --array_intersect(): Argument #2 must be of type array, string given -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 20 --array_intersect(): Argument #2 must be of type array, string given -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 22 --array_intersect(): Argument #2 must be of type array, null given -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 24 --array_intersect(): Argument #2 must be of type array, resource given -array_intersect(): Argument #2 must be of type array, resource given -Done diff --git a/ext/standard/tests/array/array_map_object1.phpt b/ext/standard/tests/array/array_map_object1.phpt deleted file mode 100644 index d86919bf9c4e..000000000000 --- a/ext/standard/tests/array/array_map_object1.phpt +++ /dev/null @@ -1,186 +0,0 @@ ---TEST-- -Test array_map() function : usage variations - object functionality ---FILE-- -getMessage(), "\n"; - } -} -test(array('SimpleClass', 'square'), array(1, 2)); - -echo "\n-- simple class with private variable and method --\n"; -class SimpleClassPri -{ - private $var1 = 10; - private static function add($n) { - return $var + $n; - } -} -test(array('SimpleClassPri', 'add'), array(1)); - -echo "\n-- simple class with protected variable and method --\n"; -class SimpleClassPro -{ - protected $var1 = 5; - protected static function mul($n) { - return $var1 * $n; - } -} -test(array('SimpleClassPro', 'mul'), array(2)); - -echo "\n-- class without members --\n"; -class EmptyClass -{ -} -test(array('EmptyClass'), array(1, 2)); - -echo "\n-- abstract class --\n"; -abstract class AbstractClass -{ - protected $var2 = 5; - abstract static function emptyFunction(); -} - -// class deriving the above abstract class -class ChildClass extends AbstractClass -{ - private $var3; - public static function emptyFunction() { - echo "defined in child\n"; - } -} -test(array('ChildClass', 'emptyFunction'), array(1, 2)); - -echo "\n-- class with final method --\n"; -class FinalClass -{ - private $var4; - final static function finalMethod() { - echo "This function can't be overloaded\n"; - } -} -test(array('FinalClass', 'finalMethod'), array(1, 2)); - -echo "\n-- class with static members --\n"; -class StaticClass -{ - static $var5 = 2; - public static function square($n) { - return ($n * $n); - } - private static function cube($n) { - return ($n * $n * $n); - } - protected static function retVal($n) { - return array($n); - } -} -test(array('StaticClass', 'square'), array(1, 2)); -test(array('StaticClass', 'cube'), array(2)); -test(array('StaticClass', 'retVal'), array(3, 4)); - -echo "-- class implementing an interface --\n"; -interface myInterface -{ - public function toImplement(); -} -class InterClass implements myInterface -{ - public static function square($n) { - return ($n * $n); - } - public function toImplement() { - return 1; - } -} -test(array('InterClass', 'square'), array(1, 2)); - -?> ---EXPECT-- -*** Testing array_map() : object functionality *** --- simple class with public variable and method -- -SimpleClass::square -array(2) { - [0]=> - int(1) - [1]=> - int(4) -} - --- 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() - --- 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() - --- class without members -- -EmptyClass -array_map(): Argument #1 ($callback) must be a valid callback or null, array callback must have exactly two members - --- abstract class -- -ChildClass::emptyFunction -defined in child -defined in child -array(2) { - [0]=> - NULL - [1]=> - NULL -} - --- class with final method -- -FinalClass::finalMethod -This function can't be overloaded -This function can't be overloaded -array(2) { - [0]=> - NULL - [1]=> - NULL -} - --- class with static members -- -StaticClass::square -array(2) { - [0]=> - int(1) - [1]=> - int(4) -} -StaticClass::cube -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() --- class implementing an interface -- -InterClass::square -array(2) { - [0]=> - int(1) - [1]=> - int(4) -} diff --git a/ext/standard/tests/array/array_map_object2.phpt b/ext/standard/tests/array/array_map_object2.phpt deleted file mode 100644 index 3b9666ce50ac..000000000000 --- a/ext/standard/tests/array/array_map_object2.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -Test array_map() function : object functionality - with non-existent class and method ---FILE-- -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 "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 --- 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" -Done diff --git a/ext/standard/tests/array/array_map_variation15.phpt b/ext/standard/tests/array/array_map_variation15.phpt deleted file mode 100644 index d053a7204639..000000000000 --- a/ext/standard/tests/array/array_map_variation15.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Test array_map() function : usage variations - non existent 'callback' function ---FILE-- -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 -Done diff --git a/ext/standard/tests/array/array_map_variation17.phpt b/ext/standard/tests/array/array_map_variation17.phpt deleted file mode 100644 index 751167baa04a..000000000000 --- a/ext/standard/tests/array/array_map_variation17.phpt +++ /dev/null @@ -1,137 +0,0 @@ ---TEST-- -Test array_map() function : usage variations - unexpected values for 'callback' argument ---FILE-- -getMessage(), "\n"; - } -}; - -fclose($fp); -echo "Done"; -?> ---EXPECT-- -*** 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 - --- Iteration 2 -- -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 - --- Iteration 4 -- -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 - --- Iteration 6 -- -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 - --- Iteration 8 -- -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 - --- Iteration 10 -- -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 - --- Iteration 12 -- -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 - --- Iteration 14 -- -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 - --- Iteration 16 -- -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 - --- 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 - --- Iteration 19 -- -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 -Done diff --git a/ext/standard/tests/array/array_merge_recursive_variation1.phpt b/ext/standard/tests/array/array_merge_recursive_variation1.phpt deleted file mode 100644 index 121f7969d43c..000000000000 --- a/ext/standard/tests/array/array_merge_recursive_variation1.phpt +++ /dev/null @@ -1,210 +0,0 @@ ---TEST-- -Test array_merge_recursive() function : usage variations - unexpected values for $arr1 argument ---FILE-- -getMessage(), "\n"; - } - - // with more arguments - echo "-- With more arguments --"; - try { - var_dump( array_merge_recursive($arr1, $arr2) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } - - $iterator++; -} - -// close the file resource used -fclose($fp); - -echo "Done"; -?> ---EXPECT-- -*** 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 - --- 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 - --- 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 - --- 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 - --- 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 - --- 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 - --- 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 - --- 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 - --- 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 - --- 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 - --- 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 - --- 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 - --- 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 - --- 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 - --- 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 - --- 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 - --- 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 - --- 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 - --- 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 - --- 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 - --- 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 - --- 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 - --- 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 - --- 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 -Done diff --git a/ext/standard/tests/array/array_merge_recursive_variation2.phpt b/ext/standard/tests/array/array_merge_recursive_variation2.phpt deleted file mode 100644 index 4588d8d160aa..000000000000 --- a/ext/standard/tests/array/array_merge_recursive_variation2.phpt +++ /dev/null @@ -1,150 +0,0 @@ ---TEST-- -Test array_merge_recursive() function : usage variations - unexpected values for $arr2 argument ---FILE-- -getMessage(), "\n"; - } - $iterator++; -} - -// close the file resource used -fclose($fp); - -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 2 --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 4 --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 6 --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 8 --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 10 --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 12 --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 14 --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 16 --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 18 --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 20 --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 22 --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 24 --array_merge_recursive(): Argument #2 must be of type array, A given -Done diff --git a/ext/standard/tests/array/array_merge_variation1.phpt b/ext/standard/tests/array/array_merge_variation1.phpt deleted file mode 100644 index 47045017fa67..000000000000 --- a/ext/standard/tests/array/array_merge_variation1.phpt +++ /dev/null @@ -1,104 +0,0 @@ ---TEST-- -Test array_merge() function : usage variations - Pass different data types to $arr1 arg ---FILE-- - ---EXPECTF-- -*** Testing array_merge() : usage variations *** - --- Iteration 1 -- - -Fatal error: Uncaught TypeError: array_merge(): Argument #1 must be of type array, int given in %s:%d -Stack trace: -#0 %s(%d): array_merge(0, Array) -#1 {main} - thrown in %s on line %d diff --git a/ext/standard/tests/array/array_merge_variation2.phpt b/ext/standard/tests/array/array_merge_variation2.phpt deleted file mode 100644 index 2ef55565742f..000000000000 --- a/ext/standard/tests/array/array_merge_variation2.phpt +++ /dev/null @@ -1,181 +0,0 @@ ---TEST-- -Test array_merge() function : usage variations - Pass different data types as $arr2 arg ---FILE-- -getMessage(), "\n"; - } - $iterator++; -}; - -fclose($fp); - -echo "Done"; -?> ---EXPECT-- -*** Testing array_merge() : usage variations *** - --- Iteration 1 -- -array_merge(): Argument #2 must be of type array, int given - --- Iteration 2 -- -array_merge(): Argument #2 must be of type array, int given - --- Iteration 3 -- -array_merge(): Argument #2 must be of type array, int given - --- Iteration 4 -- -array_merge(): Argument #2 must be of type array, int given - --- Iteration 5 -- -array_merge(): Argument #2 must be of type array, float given - --- Iteration 6 -- -array_merge(): Argument #2 must be of type array, float given - --- Iteration 7 -- -array_merge(): Argument #2 must be of type array, float given - --- Iteration 8 -- -array_merge(): Argument #2 must be of type array, float given - --- Iteration 9 -- -array_merge(): Argument #2 must be of type array, float given - --- Iteration 10 -- -array_merge(): Argument #2 must be of type array, null given - --- Iteration 11 -- -array_merge(): Argument #2 must be of type array, null given - --- Iteration 12 -- -array_merge(): Argument #2 must be of type array, true given - --- Iteration 13 -- -array_merge(): Argument #2 must be of type array, false given - --- Iteration 14 -- -array_merge(): Argument #2 must be of type array, true given - --- Iteration 15 -- -array_merge(): Argument #2 must be of type array, false given - --- Iteration 16 -- -array_merge(): Argument #2 must be of type array, string given - --- Iteration 17 -- -array_merge(): Argument #2 must be of type array, string given - --- Iteration 18 -- -array(2) { - [0]=> - int(1) - [1]=> - int(2) -} - --- Iteration 19 -- -array_merge(): Argument #2 must be of type array, string given - --- Iteration 20 -- -array_merge(): Argument #2 must be of type array, string given - --- Iteration 21 -- -array_merge(): Argument #2 must be of type array, string given - --- Iteration 22 -- -array_merge(): Argument #2 must be of type array, classA given - --- Iteration 23 -- -array_merge(): Argument #2 must be of type array, null given - --- Iteration 24 -- -array_merge(): Argument #2 must be of type array, null given - --- Iteration 25 -- -array_merge(): Argument #2 must be of type array, resource given -Done diff --git a/ext/standard/tests/array/array_udiff_assoc_variation1.phpt b/ext/standard/tests/array/array_udiff_assoc_variation1.phpt deleted file mode 100644 index 3cc54bdc4e78..000000000000 --- a/ext/standard/tests/array/array_udiff_assoc_variation1.phpt +++ /dev/null @@ -1,173 +0,0 @@ ---TEST-- -Test array_udiff_assoc() function : usage variation ---FILE-- - 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // int data - 'int 0' => 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -2345, - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, -); - -// loop through each element of the array for array1 - -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - try { - var_dump( array_udiff_assoc($value, $array2, $key_comp_func) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } -}; - -?> ---EXPECT-- -*** Testing array_udiff_assoc() : usage variation *** - ---int 0-- -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 - ---int 12345-- -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 - ---float 10.5-- -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 - ---float 12.3456789000e10-- -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 - ---float .5-- -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 - ---lowercase null-- -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 - ---lowercase false-- -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 - ---uppercase FALSE-- -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 - ---empty string SQ-- -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 - ---string SQ-- -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 - ---heredoc-- -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 - ---instance of classWithoutToString-- -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 - ---unset var-- -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 deleted file mode 100644 index 9e5c796484ae..000000000000 --- a/ext/standard/tests/array/array_udiff_assoc_variation2.phpt +++ /dev/null @@ -1,173 +0,0 @@ ---TEST-- -Test array_udiff_assoc() function : usage variation ---FILE-- - 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // int data - 'int 0' => 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -2345, - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, -); - -// loop through each element of the array for array2 - -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - try { - var_dump( array_udiff_assoc($array1, $value, $key_comp_func) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } -}; - -?> ---EXPECT-- -*** Testing array_udiff_assoc() : usage variation *** - ---int 0-- -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 - ---int 12345-- -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 - ---float 10.5-- -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 - ---float 12.3456789000e10-- -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 - ---float .5-- -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 - ---lowercase null-- -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 - ---lowercase false-- -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 - ---uppercase FALSE-- -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 - ---empty string SQ-- -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 - ---string SQ-- -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 - ---heredoc-- -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 - ---instance of classWithoutToString-- -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 - ---unset var-- -array_udiff_assoc(): Argument #2 must be of type array, null given diff --git a/ext/standard/tests/array/array_udiff_uassoc_variation1.phpt b/ext/standard/tests/array/array_udiff_uassoc_variation1.phpt deleted file mode 100644 index 4bf85a3c2098..000000000000 --- a/ext/standard/tests/array/array_udiff_uassoc_variation1.phpt +++ /dev/null @@ -1,174 +0,0 @@ ---TEST-- -Test array_udiff_uassoc() function : usage variation ---FILE-- - 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // int data - 'int 0' => 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -2345, - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, -); - -// loop through each element of the array for array1 - -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - try { - var_dump( array_udiff_uassoc($value, $array2, $data_comp_func, $key_comp_func) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } -}; - -?> ---EXPECT-- -*** Testing array_udiff_uassoc() : usage variation *** - ---int 0-- -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 - ---int 12345-- -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 - ---float 10.5-- -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 - ---float 12.3456789000e10-- -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 - ---float .5-- -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 - ---lowercase null-- -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 - ---lowercase false-- -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 - ---uppercase FALSE-- -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 - ---empty string SQ-- -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 - ---string SQ-- -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 - ---heredoc-- -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 - ---instance of classWithoutToString-- -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 - ---unset var-- -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 deleted file mode 100644 index 765e159bab54..000000000000 --- a/ext/standard/tests/array/array_udiff_uassoc_variation2.phpt +++ /dev/null @@ -1,174 +0,0 @@ ---TEST-- -Test array_udiff_uassoc() function : usage variation ---FILE-- - 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // int data - 'int 0' => 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -2345, - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, -); - -// loop through each element of the array for array2 - -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - try { - var_dump( array_udiff_uassoc($array1, $value, $data_comp_func, $key_comp_func) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } -}; - -?> ---EXPECT-- -*** Testing array_udiff_uassoc() : usage variation *** - ---int 0-- -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 - ---int 12345-- -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 - ---float 10.5-- -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 - ---float 12.3456789000e10-- -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 - ---float .5-- -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 - ---lowercase null-- -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 - ---lowercase false-- -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 - ---uppercase FALSE-- -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 - ---empty string SQ-- -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 - ---string SQ-- -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 - ---heredoc-- -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 - ---instance of classWithoutToString-- -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 - ---unset var-- -array_udiff_uassoc(): Argument #2 must be of type array, null given diff --git a/ext/standard/tests/array/array_udiff_variation1.phpt b/ext/standard/tests/array/array_udiff_variation1.phpt deleted file mode 100644 index 59cfca596864..000000000000 --- a/ext/standard/tests/array/array_udiff_variation1.phpt +++ /dev/null @@ -1,173 +0,0 @@ ---TEST-- -Test array_udiff() function : usage variation ---FILE-- - 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // int data - 'int 0' => 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -2345, - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, -); - -// loop through each element of the array for array1 - -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - try { - var_dump( array_udiff($value, $array2, $data_comp_func) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } -}; - -?> ---EXPECT-- -*** Testing array_udiff() : usage variation *** - ---int 0-- -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 - ---int 12345-- -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 - ---float 10.5-- -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 - ---float 12.3456789000e10-- -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 - ---float .5-- -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 - ---lowercase null-- -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 - ---lowercase false-- -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 - ---uppercase FALSE-- -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 - ---empty string SQ-- -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 - ---string SQ-- -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 - ---heredoc-- -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 - ---instance of classWithoutToString-- -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 - ---unset var-- -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 deleted file mode 100644 index 6637692e0b25..000000000000 --- a/ext/standard/tests/array/array_udiff_variation2.phpt +++ /dev/null @@ -1,173 +0,0 @@ ---TEST-- -Test array_udiff() function : usage variation ---FILE-- - 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // int data - 'int 0' => 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -2345, - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, -); - -// loop through each element of the array for array2 - -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - try { - var_dump( array_udiff($array1, $value, $data_comp_func) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } -}; - -?> ---EXPECT-- -*** Testing array_udiff() : usage variation *** - ---int 0-- -array_udiff(): Argument #2 must be of type array, int given - ---int 1-- -array_udiff(): Argument #2 must be of type array, int given - ---int 12345-- -array_udiff(): Argument #2 must be of type array, int given - ---int -12345-- -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 - ---float -10.5-- -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 - ---float -12.3456789000e10-- -array_udiff(): Argument #2 must be of type array, float given - ---float .5-- -array_udiff(): Argument #2 must be of type array, float given - ---uppercase NULL-- -array_udiff(): Argument #2 must be of type array, null given - ---lowercase null-- -array_udiff(): Argument #2 must be of type array, null given - ---lowercase true-- -array_udiff(): Argument #2 must be of type array, true given - ---lowercase false-- -array_udiff(): Argument #2 must be of type array, false given - ---uppercase TRUE-- -array_udiff(): Argument #2 must be of type array, true given - ---uppercase FALSE-- -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 - ---empty string SQ-- -array_udiff(): Argument #2 must be of type array, string given - ---string DQ-- -array_udiff(): Argument #2 must be of type array, string given - ---string SQ-- -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 - ---heredoc-- -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 - ---instance of classWithoutToString-- -array_udiff(): Argument #2 must be of type array, classWithoutToString given - ---undefined var-- -array_udiff(): Argument #2 must be of type array, null given - ---unset var-- -array_udiff(): Argument #2 must be of type array, null given diff --git a/ext/standard/tests/array/array_uintersect_assoc_variation1.phpt b/ext/standard/tests/array/array_uintersect_assoc_variation1.phpt deleted file mode 100644 index 64e21a30d1ae..000000000000 --- a/ext/standard/tests/array/array_uintersect_assoc_variation1.phpt +++ /dev/null @@ -1,173 +0,0 @@ ---TEST-- -Test array_uintersect_assoc() function : usage variation ---FILE-- - 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // int data - 'int 0' => 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -2345, - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, -); - -// loop through each element of the array for array1 - -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - try { - var_dump( array_uintersect_assoc($value, $array2, $data_compare_function) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } -}; - -?> ---EXPECT-- -*** Testing array_uintersect_assoc() : usage variation *** - ---int 0-- -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 - ---int 12345-- -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 - ---float 10.5-- -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 - ---float 12.3456789000e10-- -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 - ---float .5-- -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 - ---lowercase null-- -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 - ---lowercase false-- -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 - ---uppercase FALSE-- -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 - ---empty string SQ-- -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 - ---string SQ-- -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 - ---heredoc-- -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 - ---instance of classWithoutToString-- -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 - ---unset var-- -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 deleted file mode 100644 index 4078bec27dcc..000000000000 --- a/ext/standard/tests/array/array_uintersect_assoc_variation2.phpt +++ /dev/null @@ -1,173 +0,0 @@ ---TEST-- -Test array_uintersect_assoc() function : usage variation ---FILE-- - 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // int data - 'int 0' => 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -2345, - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, -); - -// loop through each element of the array for array2 - -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - try { - var_dump( array_uintersect_assoc($array1, $value, $data_compare_function) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } -}; - -?> ---EXPECT-- -*** Testing array_uintersect_assoc() : usage variation *** - ---int 0-- -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 - ---int 12345-- -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 - ---float 10.5-- -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 - ---float 12.3456789000e10-- -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 - ---float .5-- -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 - ---lowercase null-- -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 - ---lowercase false-- -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 - ---uppercase FALSE-- -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 - ---empty string SQ-- -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 - ---string SQ-- -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 - ---heredoc-- -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 - ---instance of classWithoutToString-- -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 - ---unset var-- -array_uintersect_assoc(): Argument #2 must be of type array, null given diff --git a/ext/standard/tests/array/array_uintersect_uassoc_variation1.phpt b/ext/standard/tests/array/array_uintersect_uassoc_variation1.phpt deleted file mode 100644 index 651e78e62855..000000000000 --- a/ext/standard/tests/array/array_uintersect_uassoc_variation1.phpt +++ /dev/null @@ -1,174 +0,0 @@ ---TEST-- -Test array_uintersect_uassoc() function : usage variation ---FILE-- - 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // int data - 'int 0' => 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -2345, - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, -); - -// loop through each element of the array for array1 - -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - try { - var_dump( array_uintersect_uassoc($value, $array2, $data_compare_func, $key_compare_func) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } -}; - -?> ---EXPECT-- -*** Testing array_uintersect_uassoc() : usage variation *** - ---int 0-- -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 - ---int 12345-- -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 - ---float 10.5-- -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 - ---float 12.3456789000e10-- -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 - ---float .5-- -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 - ---lowercase null-- -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 - ---lowercase false-- -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 - ---uppercase FALSE-- -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 - ---empty string SQ-- -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 - ---string SQ-- -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 - ---heredoc-- -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 - ---instance of classWithoutToString-- -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 - ---unset var-- -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 deleted file mode 100644 index e01d3b4e9572..000000000000 --- a/ext/standard/tests/array/array_uintersect_uassoc_variation2.phpt +++ /dev/null @@ -1,174 +0,0 @@ ---TEST-- -Test array_uintersect_uassoc() function : usage variation ---FILE-- - 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // int data - 'int 0' => 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -2345, - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, -); - -// loop through each element of the array for array2 - -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - try { - var_dump( array_uintersect_uassoc($array1, $value, $data_compare_func, $key_compare_func) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } -}; - -?> ---EXPECT-- -*** Testing array_uintersect_uassoc() : usage variation *** - ---int 0-- -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 - ---int 12345-- -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 - ---float 10.5-- -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 - ---float 12.3456789000e10-- -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 - ---float .5-- -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 - ---lowercase null-- -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 - ---lowercase false-- -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 - ---uppercase FALSE-- -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 - ---empty string SQ-- -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 - ---string SQ-- -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 - ---heredoc-- -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 - ---instance of classWithoutToString-- -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 - ---unset var-- -array_uintersect_uassoc(): Argument #2 must be of type array, null given diff --git a/ext/standard/tests/array/array_uintersect_variation1.phpt b/ext/standard/tests/array/array_uintersect_variation1.phpt deleted file mode 100644 index 390fc6137401..000000000000 --- a/ext/standard/tests/array/array_uintersect_variation1.phpt +++ /dev/null @@ -1,173 +0,0 @@ ---TEST-- -Test array_uintersect() function : usage variation ---FILE-- - 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // int data - 'int 0' => 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -2345, - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, -); - -// loop through each element of the array for array1 - -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - try { - var_dump( array_uintersect($value, $array2, $data_compare_function) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } -}; - -?> ---EXPECT-- -*** Testing array_uintersect() : usage variation *** - ---int 0-- -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 - ---int 12345-- -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 - ---float 10.5-- -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 - ---float 12.3456789000e10-- -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 - ---float .5-- -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 - ---lowercase null-- -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 - ---lowercase false-- -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 - ---uppercase FALSE-- -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 - ---empty string SQ-- -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 - ---string SQ-- -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 - ---heredoc-- -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 - ---instance of classWithoutToString-- -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 - ---unset var-- -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 deleted file mode 100644 index ca3a4bff3a90..000000000000 --- a/ext/standard/tests/array/array_uintersect_variation2.phpt +++ /dev/null @@ -1,173 +0,0 @@ ---TEST-- -Test array_uintersect() function : usage variation ---FILE-- - 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // int data - 'int 0' => 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -2345, - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, -); - -// loop through each element of the array for array2 - -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - try { - var_dump( array_uintersect($array1, $value, $data_compare_function) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } -}; - -?> ---EXPECT-- -*** Testing array_uintersect() : usage variation *** - ---int 0-- -array_uintersect(): Argument #2 must be of type array, int given - ---int 1-- -array_uintersect(): Argument #2 must be of type array, int given - ---int 12345-- -array_uintersect(): Argument #2 must be of type array, int given - ---int -12345-- -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 - ---float -10.5-- -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 - ---float -12.3456789000e10-- -array_uintersect(): Argument #2 must be of type array, float given - ---float .5-- -array_uintersect(): Argument #2 must be of type array, float given - ---uppercase NULL-- -array_uintersect(): Argument #2 must be of type array, null given - ---lowercase null-- -array_uintersect(): Argument #2 must be of type array, null given - ---lowercase true-- -array_uintersect(): Argument #2 must be of type array, true given - ---lowercase false-- -array_uintersect(): Argument #2 must be of type array, false given - ---uppercase TRUE-- -array_uintersect(): Argument #2 must be of type array, true given - ---uppercase FALSE-- -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 - ---empty string SQ-- -array_uintersect(): Argument #2 must be of type array, string given - ---string DQ-- -array_uintersect(): Argument #2 must be of type array, string given - ---string SQ-- -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 - ---heredoc-- -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 - ---instance of classWithoutToString-- -array_uintersect(): Argument #2 must be of type array, classWithoutToString given - ---undefined var-- -array_uintersect(): Argument #2 must be of type array, null given - ---unset var-- -array_uintersect(): Argument #2 must be of type array, null given diff --git a/ext/standard/tests/class_object/get_class_variation_001.phpt b/ext/standard/tests/class_object/get_class_variation_001.phpt deleted file mode 100644 index 09f995c21fb6..000000000000 --- a/ext/standard/tests/class_object/get_class_variation_001.phpt +++ /dev/null @@ -1,158 +0,0 @@ ---TEST-- -Test get_class() function : usage variations - passing unexpected types. ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // string data - "string", - 'string', - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for object - -foreach($values as $value) { - echo @"\nArg value: $value (type: " . gettype($value) . ")\n"; - try { - var_dump( get_class($value) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } -}; - -echo "Done"; -?> ---EXPECTF-- -*** Testing get_class() : usage variations *** - -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 - -Arg value: 1 (type: integer) -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 - -Arg value: -2345 (type: integer) -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 - -Arg value: -10.5 (type: double) -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 - -Arg value: 1.07654321E-9 (type: double) -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 - -Arg value: Array (type: array) -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 - -Arg value: Array (type: array) -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 - -Arg value: Array (type: array) -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 - -Arg value: (type: NULL) -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 - -Arg value: (type: boolean) -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 - -Arg value: (type: boolean) -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 - -Arg value: (type: string) -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 - -Arg value: string (type: string) -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 - -Arg value: (type: NULL) -get_class(): Argument #1 ($object) must be of type object, 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 deleted file mode 100644 index 3d8927882c60..000000000000 --- a/ext/standard/tests/class_object/property_exists_error.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Test property_exists() function : error conditions ---FILE-- -getMessage() . \PHP_EOL; -} - -?> ---EXPECT-- -*** 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 diff --git a/ext/standard/tests/general_functions/escapeshellarg_variation1-win32.phpt b/ext/standard/tests/general_functions/escapeshellarg_variation1-win32.phpt deleted file mode 100644 index 752b1dfa7e33..000000000000 --- a/ext/standard/tests/general_functions/escapeshellarg_variation1-win32.phpt +++ /dev/null @@ -1,107 +0,0 @@ ---TEST-- -Test escapeshellarg() function : usage variations - different data types as $arg arg ---SKIPIF-- - ---FILE-- - ---EXPECT-- -*** Testing escapeshellarg() : usage variations *** - --- Iteration 1 -- -string(3) ""0"" - --- Iteration 2 -- -string(3) ""1"" - --- Iteration 3 -- -string(4) ""12"" - --- Iteration 4 -- -string(5) ""-12"" - --- Iteration 5 -- -string(12) ""2147483647"" - --- Iteration 6 -- -string(6) ""10.5"" - --- Iteration 7 -- -string(7) ""-10.5"" - --- Iteration 8 -- -string(10) ""123.4567"" - --- Iteration 9 -- -string(12) ""0.01234567"" - --- Iteration 10 -- -string(5) ""0.5"" - --- Iteration 11 -- -string(3) ""1"" - --- Iteration 12 -- -string(2) """" - --- Iteration 13 -- -string(3) ""1"" - --- Iteration 14 -- -string(2) """" - --- Iteration 15 -- -string(2) """" - --- Iteration 16 -- -string(2) """" diff --git a/ext/standard/tests/general_functions/escapeshellarg_variation1.phpt b/ext/standard/tests/general_functions/escapeshellarg_variation1.phpt deleted file mode 100644 index 028b987eece2..000000000000 --- a/ext/standard/tests/general_functions/escapeshellarg_variation1.phpt +++ /dev/null @@ -1,106 +0,0 @@ ---TEST-- -Test escapeshellarg() function : usage variations - different data types as $y arg ---SKIPIF-- - ---FILE-- - ---EXPECT-- -*** Testing escapeshellarg() : usage variations *** - --- Iteration 1 -- -string(3) "'0'" - --- Iteration 2 -- -string(3) "'1'" - --- Iteration 3 -- -string(4) "'12'" - --- Iteration 4 -- -string(5) "'-12'" - --- Iteration 5 -- -string(12) "'2147483647'" - --- Iteration 6 -- -string(6) "'10.5'" - --- Iteration 7 -- -string(7) "'-10.5'" - --- Iteration 8 -- -string(10) "'123.4567'" - --- Iteration 9 -- -string(12) "'0.01234567'" - --- Iteration 10 -- -string(5) "'0.5'" - --- Iteration 11 -- -string(3) "'1'" - --- Iteration 12 -- -string(2) "''" - --- Iteration 13 -- -string(3) "'1'" - --- Iteration 14 -- -string(2) "''" - --- Iteration 15 -- -string(2) "''" - --- Iteration 16 -- -string(2) "''" diff --git a/ext/standard/tests/math/abs_variation.phpt b/ext/standard/tests/math/abs_variation.phpt deleted file mode 100644 index d7f878bc01bb..000000000000 --- a/ext/standard/tests/math/abs_variation.phpt +++ /dev/null @@ -1,138 +0,0 @@ ---TEST-- -Test abs() function : usage variations - different data types as $number arg ---FILE-- -getMessage(), "\n"; - } - $iterator++; -}; - -fclose($fp); -?> ---EXPECTF-- -*** Testing abs() : usage variations *** - --- Iteration 1 -- - -Deprecated: abs(): Passing null to parameter #1 ($num) of type int|float is deprecated in %s on line %d -int(0) - --- Iteration 2 -- - -Deprecated: abs(): Passing null to parameter #1 ($num) of type int|float is deprecated in %s on line %d -int(0) - --- Iteration 3 -- -int(1) - --- Iteration 4 -- -int(0) - --- Iteration 5 -- -int(1) - --- Iteration 6 -- -int(0) - --- Iteration 7 -- -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 - --- Iteration 9 -- -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 - --- Iteration 11 -- -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 - --- Iteration 13 -- -abs(): Argument #1 ($num) must be of type int|float, classA given - --- Iteration 14 -- - -Deprecated: abs(): Passing null to parameter #1 ($num) of type int|float is deprecated in %s on line %d -int(0) - --- Iteration 15 -- - -Deprecated: abs(): Passing null to parameter #1 ($num) of type int|float is deprecated in %s on line %d -int(0) - --- Iteration 16 -- -abs(): Argument #1 ($num) must be of type int|float, resource given diff --git a/ext/standard/tests/math/ceil_variation1.phpt b/ext/standard/tests/math/ceil_variation1.phpt deleted file mode 100644 index 7751946ea954..000000000000 --- a/ext/standard/tests/math/ceil_variation1.phpt +++ /dev/null @@ -1,131 +0,0 @@ ---TEST-- -Test ceil() function : usage variations - different data types as $value arg ---INI-- -precision=14 ---FILE-- -getMessage(), "\n"; - } - $iterator++; -}; -fclose($fp); -?> ---EXPECTF-- -*** Testing ceil() : usage variations *** - --- Iteration 1 -- - -Deprecated: ceil(): Passing null to parameter #1 ($num) of type int|float is deprecated in %s on line %d -float(0) - --- Iteration 2 -- - -Deprecated: ceil(): Passing null to parameter #1 ($num) of type int|float is deprecated in %s on line %d -float(0) - --- Iteration 3 -- -float(1) - --- Iteration 4 -- -float(0) - --- Iteration 5 -- -float(1) - --- Iteration 6 -- -float(0) - --- Iteration 7 -- -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 - --- Iteration 9 -- -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 - --- Iteration 11 -- -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 - --- Iteration 13 -- -ceil(): Argument #1 ($num) must be of type int|float, classA given - --- Iteration 14 -- - -Deprecated: ceil(): Passing null to parameter #1 ($num) of type int|float is deprecated in %s on line %d -float(0) - --- Iteration 15 -- - -Deprecated: ceil(): Passing null to parameter #1 ($num) of type int|float is deprecated in %s on line %d -float(0) - --- Iteration 16 -- -ceil(): Argument #1 ($num) must be of type int|float, resource given diff --git a/ext/standard/tests/math/floor_variation1.phpt b/ext/standard/tests/math/floor_variation1.phpt deleted file mode 100644 index c9ec5e710c51..000000000000 --- a/ext/standard/tests/math/floor_variation1.phpt +++ /dev/null @@ -1,131 +0,0 @@ ---TEST-- -Test floor() function : usage variations - different data types as $value arg ---INI-- -precision=14 ---FILE-- -getMessage(), "\n"; - } - $iterator++; -}; -fclose($fp); -?> ---EXPECTF-- -*** Testing floor() : usage variations *** - --- Iteration 1 -- - -Deprecated: floor(): Passing null to parameter #1 ($num) of type int|float is deprecated in %s on line %d -float(0) - --- Iteration 2 -- - -Deprecated: floor(): Passing null to parameter #1 ($num) of type int|float is deprecated in %s on line %d -float(0) - --- Iteration 3 -- -float(1) - --- Iteration 4 -- -float(0) - --- Iteration 5 -- -float(1) - --- Iteration 6 -- -float(0) - --- Iteration 7 -- -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 - --- Iteration 9 -- -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 - --- Iteration 11 -- -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 - --- Iteration 13 -- -floor(): Argument #1 ($num) must be of type int|float, classA given - --- Iteration 14 -- - -Deprecated: floor(): Passing null to parameter #1 ($num) of type int|float is deprecated in %s on line %d -float(0) - --- Iteration 15 -- - -Deprecated: floor(): Passing null to parameter #1 ($num) of type int|float is deprecated in %s on line %d -float(0) - --- Iteration 16 -- -floor(): Argument #1 ($num) must be of type int|float, resource given diff --git a/ext/standard/tests/math/round_variation1.phpt b/ext/standard/tests/math/round_variation1.phpt deleted file mode 100644 index 2a2adf27cae0..000000000000 --- a/ext/standard/tests/math/round_variation1.phpt +++ /dev/null @@ -1,175 +0,0 @@ ---TEST-- -Test round() function : usage variations - different data types as $val argument ---INI-- -precision=14 ---FILE-- -getMessage(), "\n"; - } - $iterator++; -}; -fclose($fp); -?> ---EXPECTF-- -*** Testing round() : usage variations *** - --- Iteration 1 -- -float(0) - --- Iteration 2 -- -float(1) - --- Iteration 3 -- -float(12345) - --- Iteration 4 -- -float(-2345) - --- Iteration 5 -- -float(2147483647) - --- Iteration 6 -- -float(10.5) - --- Iteration 7 -- -float(-10.5) - --- Iteration 8 -- -float(123456789000) - --- Iteration 9 -- -float(1.23457E-9) - --- Iteration 10 -- -float(0.5) - --- Iteration 11 -- - -Deprecated: round(): Passing null to parameter #1 ($num) of type int|float is deprecated in %s on line %d -float(0) - --- Iteration 12 -- - -Deprecated: round(): Passing null to parameter #1 ($num) of type int|float is deprecated in %s on line %d -float(0) - --- Iteration 13 -- -float(1) - --- Iteration 14 -- -float(0) - --- Iteration 15 -- -float(1) - --- Iteration 16 -- -float(0) - --- Iteration 17 -- -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 - --- Iteration 19 -- -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 - --- Iteration 21 -- -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 - --- Iteration 23 -- -round(): Argument #1 ($num) must be of type int|float, classA given - --- Iteration 24 -- - -Deprecated: round(): Passing null to parameter #1 ($num) of type int|float is deprecated in %s on line %d -float(0) - --- Iteration 25 -- - -Deprecated: round(): Passing null to parameter #1 ($num) of type int|float is deprecated in %s on line %d -float(0) - --- Iteration 26 -- -round(): Argument #1 ($num) must be of type int|float, resource given diff --git a/ext/standard/tests/password/password_hash_error.phpt b/ext/standard/tests/password/password_hash_error.phpt deleted file mode 100644 index a9e26f091675..000000000000 --- a/ext/standard/tests/password/password_hash_error.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -Test error operation of password_hash() ---FILE-- -getMessage(), "\n"; -} - -try { - password_hash("foo", array()); -} catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; -} - -try { - var_dump(password_hash("foo", 19, new StdClass)); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; -} - -try { - var_dump(password_hash("foo", PASSWORD_BCRYPT, "baz")); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; -} - -try { - var_dump(password_hash(array(), PASSWORD_BCRYPT)); -} catch (TypeError $e) { - echo $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 diff --git a/ext/standard/tests/password/password_needs_rehash_error.phpt b/ext/standard/tests/password/password_needs_rehash_error.phpt deleted file mode 100644 index 283a6b5387e0..000000000000 --- a/ext/standard/tests/password/password_needs_rehash_error.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -Test error operation of password_needs_rehash() ---FILE-- -getMessage(), "\n"; -} - -try { - var_dump(password_needs_rehash('', [])); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; -} - -try { - var_dump(password_needs_rehash(array(), PASSWORD_BCRYPT)); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; -} - -try { - var_dump(password_needs_rehash("", PASSWORD_BCRYPT, "foo")); -} catch (TypeError $e) { - echo $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 -OK! diff --git a/ext/standard/tests/password/password_verify_error.phpt b/ext/standard/tests/password/password_verify_error.phpt deleted file mode 100644 index 76c4f6dcb65e..000000000000 --- a/ext/standard/tests/password/password_verify_error.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Test error operation of password_verify() ---FILE-- -getMessage(), "\n"; -} - -?> ---EXPECT-- -password_verify() expects exactly 2 arguments, 1 given diff --git a/ext/standard/tests/strings/join_error1.phpt b/ext/standard/tests/strings/join_error1.phpt deleted file mode 100644 index 0bb451a73d98..000000000000 --- a/ext/standard/tests/strings/join_error1.phpt +++ /dev/null @@ -1,149 +0,0 @@ ---TEST-- -Test join() function : usage variations - unexpected values for 'pieces' argument(Bug#42789) ---FILE-- -getMessage(), "\n"; - } - - $counter ++; -} - -// close the resources used -fclose($fp); - -echo "Done\n"; -?> ---EXPECT-- -*** Testing join() : usage variations *** - ---- Testing join() by supplying different values for 'pieces' argument --- --- Iteration 1 -- -join(): Argument #2 ($array) must be of type ?array, int given --- Iteration 2 -- -join(): Argument #2 ($array) must be of type ?array, int given --- Iteration 3 -- -join(): Argument #2 ($array) must be of type ?array, int given --- Iteration 4 -- -join(): Argument #2 ($array) must be of type ?array, int given --- Iteration 5 -- -join(): Argument #2 ($array) must be of type ?array, float given --- Iteration 6 -- -join(): Argument #2 ($array) must be of type ?array, float given --- Iteration 7 -- -join(): Argument #2 ($array) must be of type ?array, float given --- Iteration 8 -- -join(): Argument #2 ($array) must be of type ?array, float given --- Iteration 9 -- -join(): Argument #2 ($array) must be of type ?array, float given --- Iteration 10 -- -join(): Argument #2 ($array) must be of type ?array, true given --- Iteration 11 -- -join(): Argument #2 ($array) must be of type ?array, false given --- Iteration 12 -- -join(): Argument #2 ($array) must be of type ?array, true given --- Iteration 13 -- -join(): Argument #2 ($array) must be of type ?array, false given --- Iteration 14 -- -join(): Argument #2 ($array) must be of type ?array, string given --- Iteration 15 -- -join(): Argument #2 ($array) must be of type ?array, string given --- Iteration 16 -- -join(): Argument #2 ($array) must be of type ?array, test given --- Iteration 17 -- -join(): Argument #2 ($array) must be of type ?array, string given --- Iteration 18 -- -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 --- Iteration 20 -- -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 --- Iteration 22 -- -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 -Done diff --git a/ext/standard/tests/strings/join_variation1.phpt b/ext/standard/tests/strings/join_variation1.phpt deleted file mode 100644 index 256f361460b2..000000000000 --- a/ext/standard/tests/strings/join_variation1.phpt +++ /dev/null @@ -1,133 +0,0 @@ ---TEST-- -Test join() function : usage variations - unexpected values for 'glue' argument ---FILE-- - 'red', 'item' => 'pen'), - - // boolean values - true, - false, - TRUE, - FALSE, - - // objects - new test(), - - // empty string - "", - '', - - // resource variable - $fp, -); - - -// loop through each element of the array and check the working of join() -// when $glue argument is supplied with different values -echo "\n--- Testing join() by supplying different values for 'glue' argument ---\n"; -$counter = 1; -for($index = 0; $index < count($values); $index ++) { - echo "-- Iteration $counter --\n"; - $glue = $values [$index]; - - try { - var_dump(join($glue, $pieces)); - } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; - } - - $counter++; -} - -echo "Done\n"; -?> ---EXPECT-- -*** Testing join() : usage variations *** - ---- Testing join() by supplying different values for 'glue' argument --- --- Iteration 1 -- -string(17) "element10element2" --- Iteration 2 -- -string(17) "element11element2" --- Iteration 3 -- -string(21) "element112345element2" --- Iteration 4 -- -string(21) "element1-2345element2" --- Iteration 5 -- -string(20) "element110.5element2" --- Iteration 6 -- -string(21) "element1-10.5element2" --- Iteration 7 -- -string(28) "element1101234567000element2" --- Iteration 8 -- -string(29) "element11.07654321E-9element2" --- Iteration 9 -- -string(19) "element10.5element2" --- Iteration 10 -- -join(): Argument #1 ($separator) must be of type string, array given --- Iteration 11 -- -join(): Argument #1 ($separator) must be of type string, array given --- Iteration 12 -- -join(): Argument #1 ($separator) must be of type string, array given --- Iteration 13 -- -join(): Argument #1 ($separator) must be of type string, array given --- Iteration 14 -- -join(): Argument #1 ($separator) must be of type string, array given --- Iteration 15 -- -string(17) "element11element2" --- Iteration 16 -- -string(16) "element1element2" --- Iteration 17 -- -string(17) "element11element2" --- Iteration 18 -- -string(16) "element1element2" --- Iteration 19 -- -string(26) "element1testObjectelement2" --- Iteration 20 -- -string(16) "element1element2" --- Iteration 21 -- -string(16) "element1element2" --- Iteration 22 -- -join(): Argument #1 ($separator) must be of type array|string, resource given -Done diff --git a/ext/standard/tests/strings/sprintf_variation1.phpt b/ext/standard/tests/strings/sprintf_variation1.phpt deleted file mode 100644 index 6b9430e38666..000000000000 --- a/ext/standard/tests/strings/sprintf_variation1.phpt +++ /dev/null @@ -1,213 +0,0 @@ ---TEST-- -Test sprintf() function : usage variations - unexpected values for format argument ---FILE-- - 'red', 'item' => 'pen'), - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // object data - new sample(), - - // resource data - $file_handle -); - -// loop through each element of the array for format - -$count = 1; -foreach($values as $value) { - echo "\n-- Iteration $count --\n"; - - // with default argument - try { - var_dump(sprintf($value)); - } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; - } - - // with two arguments - try { - var_dump(sprintf($value, $arg1)); - } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; - } - - // with three arguments - try { - var_dump(sprintf($value, $arg1, $arg2)); - } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; - } - - $count++; -} - -// close the resource -fclose($file_handle); - -echo "Done"; -?> ---EXPECT-- -*** Testing sprintf() : with unexpected values for format argument *** - --- Iteration 1 -- -string(1) "0" -string(1) "0" -string(1) "0" - --- Iteration 2 -- -string(1) "1" -string(1) "1" -string(1) "1" - --- Iteration 3 -- -string(5) "12345" -string(5) "12345" -string(5) "12345" - --- Iteration 4 -- -string(5) "-2345" -string(5) "-2345" -string(5) "-2345" - --- Iteration 5 -- -string(4) "10.5" -string(4) "10.5" -string(4) "10.5" - --- Iteration 6 -- -string(5) "-10.5" -string(5) "-10.5" -string(5) "-10.5" - --- Iteration 7 -- -string(12) "101234567000" -string(12) "101234567000" -string(12) "101234567000" - --- Iteration 8 -- -string(13) "1.07654321E-9" -string(13) "1.07654321E-9" -string(13) "1.07654321E-9" - --- Iteration 9 -- -string(3) "0.5" -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 - --- 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 - --- 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 - --- 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 - --- 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 - --- Iteration 15 -- -string(1) "1" -string(1) "1" -string(1) "1" - --- Iteration 16 -- -string(0) "" -string(0) "" -string(0) "" - --- Iteration 17 -- -string(1) "1" -string(1) "1" -string(1) "1" - --- Iteration 18 -- -string(0) "" -string(0) "" -string(0) "" - --- Iteration 19 -- -string(0) "" -string(0) "" -string(0) "" - --- Iteration 20 -- -string(0) "" -string(0) "" -string(0) "" - --- Iteration 21 -- -string(6) "Object" -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 -Done diff --git a/ext/standard/tests/strings/vprintf_variation2.phpt b/ext/standard/tests/strings/vprintf_variation2.phpt deleted file mode 100644 index f6d92e577402..000000000000 --- a/ext/standard/tests/strings/vprintf_variation2.phpt +++ /dev/null @@ -1,168 +0,0 @@ ---TEST-- -Test vprintf() function : usage variations - unexpected values for args argument ---FILE-- -getMessage(), "\n"; - } catch (\ValueError $e) { - echo $e->getMessage(), "\n"; - } - $counter++; -}; - -// closing the resource -fclose($file_handle); - -?> ---EXPECT-- -*** Testing vprintf() : with unexpected values for args argument *** - --- Iteration 1 -- -vprintf(): Argument #2 ($values) must be of type array, int given - --- Iteration 2 -- -vprintf(): Argument #2 ($values) must be of type array, int given - --- Iteration 3 -- -vprintf(): Argument #2 ($values) must be of type array, int given - --- Iteration 4 -- -vprintf(): Argument #2 ($values) must be of type array, int given - --- Iteration 5 -- -vprintf(): Argument #2 ($values) must be of type array, float given - --- Iteration 6 -- -vprintf(): Argument #2 ($values) must be of type array, float given - --- Iteration 7 -- -vprintf(): Argument #2 ($values) must be of type array, float given - --- Iteration 8 -- -vprintf(): Argument #2 ($values) must be of type array, float given - --- Iteration 9 -- -vprintf(): Argument #2 ($values) must be of type array, float given - --- Iteration 10 -- -vprintf(): Argument #2 ($values) must be of type array, null given - --- Iteration 11 -- -vprintf(): Argument #2 ($values) must be of type array, null given - --- Iteration 12 -- -vprintf(): Argument #2 ($values) must be of type array, true given - --- Iteration 13 -- -vprintf(): Argument #2 ($values) must be of type array, false given - --- Iteration 14 -- -vprintf(): Argument #2 ($values) must be of type array, true given - --- Iteration 15 -- -vprintf(): Argument #2 ($values) must be of type array, false given - --- Iteration 16 -- -vprintf(): Argument #2 ($values) must be of type array, string given - --- Iteration 17 -- -vprintf(): Argument #2 ($values) must be of type array, string given - --- Iteration 18 -- -vprintf(): Argument #2 ($values) must be of type array, string given - --- Iteration 19 -- -vprintf(): Argument #2 ($values) must be of type array, string given - --- Iteration 20 -- -vprintf(): Argument #2 ($values) must be of type array, sample given - --- Iteration 21 -- -vprintf(): Argument #2 ($values) must be of type array, null given - --- Iteration 22 -- -vprintf(): Argument #2 ($values) must be of type array, null given - --- Iteration 23 -- -vprintf(): Argument #2 ($values) must be of type array, resource given From 6e14f88bb4bd688ede6e61e31543e9ad2c5a31da Mon Sep 17 00:00:00 2001 From: Jordi Kroon Date: Wed, 16 Sep 2026 08:46:30 -0400 Subject: [PATCH 4/7] curl: replace external URLs with local test server in tests (#21805) --- ext/curl/tests/bug52202.phpt | 2 +- ext/curl/tests/bug64267.phpt | 13 +++++-------- ext/curl/tests/bug68089.phpt | 2 +- ext/curl/tests/bug71523.phpt | 5 +++-- ext/curl/tests/bug78775.phpt | 2 +- ext/curl/tests/curl_upkeep_001.phpt | 6 +++--- 6 files changed, 14 insertions(+), 16 deletions(-) diff --git a/ext/curl/tests/bug52202.phpt b/ext/curl/tests/bug52202.phpt index fc773aae4f5b..e375f3422a23 100644 --- a/ext/curl/tests/bug52202.phpt +++ b/ext/curl/tests/bug52202.phpt @@ -4,7 +4,7 @@ Bug #52202 (CURLOPT_PRIVATE gets clobbered) curl --FILE-- --FILE-- true, @@ -30,8 +27,8 @@ var_dump(curl_setopt_array($c, [ curl_exec($c); var_dump(curl_getinfo($c, CURLINFO_RESPONSE_CODE)); ?> ---EXPECTF-- +--EXPECT-- TEST bool(true) bool(true) -int(30%d) +int(200) diff --git a/ext/curl/tests/bug68089.phpt b/ext/curl/tests/bug68089.phpt index 6a909c39f770..aac4f62e5d69 100644 --- a/ext/curl/tests/bug68089.phpt +++ b/ext/curl/tests/bug68089.phpt @@ -4,7 +4,7 @@ Bug #68089 (NULL byte injection - cURL lib) curl --FILE-- --FILE-- = 7.62.0'); ?> --FILE-- Date: Mon, 24 Aug 2026 10:36:56 -0400 Subject: [PATCH 5/7] ext/sqlite3: reject close() from inside a callback SQLite3::close() called from within a userland function, aggregate, collation or authorizer callback freed the registered statements and functions while sqlite3 was still executing, corrupting the active statement and crashing the request. Track callback re-entry with a per-database counter shared by all four callback kinds and throw an Error from close() while it is non-zero; the database stays usable and can be closed after the query completes. Closes GH-23650 --- NEWS | 4 ++ ext/sqlite3/php_sqlite3_structs.h | 3 ++ ext/sqlite3/sqlite3.c | 52 +++++++++++++++++++ .../tests/sqlite3_close_from_callback.phpt | 35 +++++++++++++ ...sqlite3_close_from_callback_aggregate.phpt | 41 +++++++++++++++ ...qlite3_close_from_callback_authorizer.phpt | 38 ++++++++++++++ ...sqlite3_close_from_callback_collation.phpt | 39 ++++++++++++++ 7 files changed, 212 insertions(+) create mode 100644 ext/sqlite3/tests/sqlite3_close_from_callback.phpt create mode 100644 ext/sqlite3/tests/sqlite3_close_from_callback_aggregate.phpt create mode 100644 ext/sqlite3/tests/sqlite3_close_from_callback_authorizer.phpt create mode 100644 ext/sqlite3/tests/sqlite3_close_from_callback_collation.phpt diff --git a/NEWS b/NEWS index 9a862b7e0e1d..50815738590c 100644 --- a/NEWS +++ b/NEWS @@ -27,6 +27,10 @@ PHP NEWS . Fixed PDOStatement::getColumnMeta() reading out of bounds for an invalid column index. (Ilia Alshanetsky) +- SQLite: + . Fixed a crash when SQLite3::close() is called from a userland callback. + (Ilia Alshanetsky) + - Zip: . Fixed ZipArchive::extractTo() ignoring files given in a non-list array. (David Carlier) diff --git a/ext/sqlite3/php_sqlite3_structs.h b/ext/sqlite3/php_sqlite3_structs.h index 6d445d6642db..43e595affe1b 100644 --- a/ext/sqlite3/php_sqlite3_structs.h +++ b/ext/sqlite3/php_sqlite3_structs.h @@ -50,6 +50,7 @@ typedef struct _php_sqlite3_func { zend_fcall_info_cache func; zend_fcall_info_cache step; zend_fcall_info_cache fini; + unsigned int *in_callback_ptr; } php_sqlite3_func; /* Structure for SQLite collation function */ @@ -58,6 +59,7 @@ typedef struct _php_sqlite3_collation { const char *collation_name; zend_fcall_info_cache cmp_func; + unsigned int *in_callback_ptr; } php_sqlite3_collation; /* Structure for SQLite Database object. */ @@ -69,6 +71,7 @@ typedef struct _php_sqlite3_db_object { zend_fcall_info_cache authorizer_fcc; bool exception; + unsigned int in_callback; zend_llist free_list; zend_object zo; diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c index 20714c38aada..93e50b97c7ff 100644 --- a/ext/sqlite3/sqlite3.c +++ b/ext/sqlite3/sqlite3.c @@ -191,6 +191,10 @@ PHP_METHOD(SQLite3, close) } if (db_obj->initialised) { + if (db_obj->in_callback) { + zend_throw_error(NULL, "Cannot close SQLite3 database while inside a callback"); + RETURN_THROWS(); + } zend_llist_clean(&(db_obj->free_list)); if(db_obj->db) { errcode = sqlite3_close(db_obj->db); @@ -774,6 +778,9 @@ static int sqlite3_do_callback(zend_fcall_info_cache *fcc, uint32_t argc, sqlite uint32_t fake_argc; zend_result ret = SUCCESS; php_sqlite3_agg_context *agg_context = NULL; + bool bailout = false; + php_sqlite3_func *cb_func = (php_sqlite3_func *)sqlite3_user_data(context); + unsigned int *in_callback = cb_func ? cb_func->in_callback_ptr : NULL; if (is_agg) { is_agg = 2; @@ -781,6 +788,10 @@ static int sqlite3_do_callback(zend_fcall_info_cache *fcc, uint32_t argc, sqlite fake_argc = argc + is_agg; + if (in_callback) { + (*in_callback)++; + } + /* build up the params */ if (fake_argc) { zargs = (zval *)safe_emalloc(fake_argc, sizeof(zval), 0); @@ -823,7 +834,15 @@ static int sqlite3_do_callback(zend_fcall_info_cache *fcc, uint32_t argc, sqlite } } + zend_try { zend_call_known_fcc(fcc, &retval, fake_argc, zargs, /* named_params */ NULL); + } zend_catch { + bailout = true; + } zend_end_try(); + + if (in_callback) { + (*in_callback)--; + } /* clean up the params */ if (is_agg) { @@ -889,6 +908,9 @@ static int sqlite3_do_callback(zend_fcall_info_cache *fcc, uint32_t argc, sqlite if (!Z_ISUNDEF(retval)) { zval_ptr_dtor(&retval); } + if (bailout) { + zend_bailout(); + } return ret; } /* }}}*/ @@ -929,6 +951,7 @@ static int php_sqlite3_callback_compare(void *coll, int a_len, const void *a, in zval zargs[2]; zval retval; int ret = 0; + bool bailout = false; // Exception occurred on previous callback. Don't attempt to call function. if (EG(exception)) { @@ -938,10 +961,26 @@ static int php_sqlite3_callback_compare(void *coll, int a_len, const void *a, in ZVAL_STRINGL(&zargs[0], a, a_len); ZVAL_STRINGL(&zargs[1], b, b_len); + if (collation->in_callback_ptr) { + (*collation->in_callback_ptr)++; + } + + zend_try { zend_call_known_fcc(&collation->cmp_func, &retval, /* argc */ 2, zargs, /* named_params */ NULL); + } zend_catch { + bailout = true; + } zend_end_try(); + + if (collation->in_callback_ptr) { + (*collation->in_callback_ptr)--; + } zval_ptr_dtor(&zargs[0]); zval_ptr_dtor(&zargs[1]); + if (bailout) { + zval_ptr_dtor(&retval); + zend_bailout(); + } if (EG(exception)) { ret = 0; @@ -988,6 +1027,7 @@ PHP_METHOD(SQLite3, createFunction) } func = (php_sqlite3_func *)ecalloc(1, sizeof(*func)); + func->in_callback_ptr = &db_obj->in_callback; if (sqlite3_create_function(db_obj->db, sql_func, sql_func_num_args, flags | SQLITE_UTF8, func, php_sqlite3_callback_func, NULL, NULL) == SQLITE_OK) { func->func_name = estrdup(sql_func); @@ -1037,6 +1077,7 @@ PHP_METHOD(SQLite3, createAggregate) } func = (php_sqlite3_func *)ecalloc(1, sizeof(*func)); + func->in_callback_ptr = &db_obj->in_callback; if (sqlite3_create_function(db_obj->db, sql_func, sql_func_num_args, SQLITE_UTF8, func, NULL, php_sqlite3_callback_step, php_sqlite3_callback_final) == SQLITE_OK) { func->func_name = estrdup(sql_func); @@ -1085,6 +1126,7 @@ PHP_METHOD(SQLite3, createCollation) } collation = (php_sqlite3_collation *)ecalloc(1, sizeof(*collation)); + collation->in_callback_ptr = &db_obj->in_callback; if (sqlite3_create_collation(db_obj->db, collation_name, SQLITE_UTF8, collation, php_sqlite3_callback_compare) == SQLITE_OK) { collation->collation_name = estrdup(collation_name); @@ -2151,8 +2193,15 @@ static int php_sqlite3_authorizer(void *autharg, int action, const char *arg1, c } int authreturn = SQLITE_DENY; + bool bailout = false; + db_obj->in_callback++; + zend_try { zend_call_known_fcc(&db_obj->authorizer_fcc, &retval, /* argc */ 5, argv, /* named_params */ NULL); + } zend_catch { + bailout = true; + } zend_end_try(); + db_obj->in_callback--; if (Z_ISUNDEF(retval)) { php_sqlite3_error(db_obj, 0, "An error occurred while invoking the authorizer callback"); } else { @@ -2176,6 +2225,9 @@ static int php_sqlite3_authorizer(void *autharg, int action, const char *arg1, c zval_ptr_dtor(&argv[3]); zval_ptr_dtor(&argv[4]); + if (bailout) { + zend_bailout(); + } return authreturn; } /* }}} */ diff --git a/ext/sqlite3/tests/sqlite3_close_from_callback.phpt b/ext/sqlite3/tests/sqlite3_close_from_callback.phpt new file mode 100644 index 000000000000..0b5523717f76 --- /dev/null +++ b/ext/sqlite3/tests/sqlite3_close_from_callback.phpt @@ -0,0 +1,35 @@ +--TEST-- +SQLite3::close() from within a UDF callback must not corrupt active statement +--EXTENSIONS-- +sqlite3 +--FILE-- +createFunction('boom', function () use ($db) { + try { + var_dump($db->close()); + } catch (Throwable $e) { + echo $e::class, ": ", $e->getMessage(), "\n"; + } + return 1; +}); +$stmt = $db->prepare('SELECT boom()'); +var_dump($stmt !== false); +$res = $stmt->execute(); +var_dump($res !== false); +var_dump($res->fetchArray(SQLITE3_NUM)); +$res->finalize(); +var_dump($db->close()); +echo "done\n"; +?> +--EXPECT-- +bool(true) +Error: Cannot close SQLite3 database while inside a callback +bool(true) +Error: Cannot close SQLite3 database while inside a callback +array(1) { + [0]=> + int(1) +} +bool(true) +done diff --git a/ext/sqlite3/tests/sqlite3_close_from_callback_aggregate.phpt b/ext/sqlite3/tests/sqlite3_close_from_callback_aggregate.phpt new file mode 100644 index 000000000000..b5bdb9615a78 --- /dev/null +++ b/ext/sqlite3/tests/sqlite3_close_from_callback_aggregate.phpt @@ -0,0 +1,41 @@ +--TEST-- +SQLite3::close() from within a createAggregate() callback must not corrupt active statement +--EXTENSIONS-- +sqlite3 +--FILE-- +exec('CREATE TABLE t (a INTEGER)'); +$db->exec('INSERT INTO t VALUES (1)'); +$db->exec('INSERT INTO t VALUES (2)'); + +$reported = false; +$db->createAggregate('agg', function ($context, $rows, $a) use (&$db, &$reported) { + if (!$reported) { + $reported = true; + try { + var_dump($db->close()); + } catch (Throwable $e) { + echo $e::class, ": ", $e->getMessage(), "\n"; + } + } + return (int) $context + $a; +}, function ($context, $rows) { + return $context; +}, 1); + +$stmt = $db->prepare('SELECT agg(a) FROM t'); +$res = $stmt->execute(); +var_dump($res->fetchArray(SQLITE3_NUM)); +$res->finalize(); +var_dump($db->close()); +echo "done\n"; +?> +--EXPECT-- +Error: Cannot close SQLite3 database while inside a callback +array(1) { + [0]=> + int(3) +} +bool(true) +done diff --git a/ext/sqlite3/tests/sqlite3_close_from_callback_authorizer.phpt b/ext/sqlite3/tests/sqlite3_close_from_callback_authorizer.phpt new file mode 100644 index 000000000000..1d5cf9e49227 --- /dev/null +++ b/ext/sqlite3/tests/sqlite3_close_from_callback_authorizer.phpt @@ -0,0 +1,38 @@ +--TEST-- +SQLite3::close() from within a setAuthorizer() callback must not finalize live statements +--EXTENSIONS-- +sqlite3 +--FILE-- +exec('CREATE TABLE t (a INTEGER)'); +$db->exec('INSERT INTO t VALUES (7)'); +$live = $db->prepare('SELECT a FROM t'); + +$reported = false; +$db->setAuthorizer(function ($action, $arg1, $arg2, $arg3, $arg4) use (&$db, &$reported) { + if (!$reported) { + $reported = true; + try { + var_dump($db->close()); + } catch (Throwable $e) { + echo $e::class, ": ", $e->getMessage(), "\n"; + } + } + return SQLite3::OK; +}); + +$db->prepare('SELECT 1'); + +$res = $live->execute(); +var_dump($res->fetchArray(SQLITE3_NUM)); +$res->finalize(); +echo "done\n"; +?> +--EXPECT-- +Error: Cannot close SQLite3 database while inside a callback +array(1) { + [0]=> + int(7) +} +done diff --git a/ext/sqlite3/tests/sqlite3_close_from_callback_collation.phpt b/ext/sqlite3/tests/sqlite3_close_from_callback_collation.phpt new file mode 100644 index 000000000000..16906894161c --- /dev/null +++ b/ext/sqlite3/tests/sqlite3_close_from_callback_collation.phpt @@ -0,0 +1,39 @@ +--TEST-- +SQLite3::close() from within a createCollation() callback must not corrupt active statement +--EXTENSIONS-- +sqlite3 +--FILE-- +exec('CREATE TABLE t (s TEXT)'); +$db->exec("INSERT INTO t VALUES ('b')"); +$db->exec("INSERT INTO t VALUES ('a')"); + +$reported = false; +$db->createCollation('CB', function ($x, $y) use (&$db, &$reported) { + if (!$reported) { + $reported = true; + try { + var_dump($db->close()); + } catch (Throwable $e) { + echo $e::class, ": ", $e->getMessage(), "\n"; + } + } + return strcmp($x, $y); +}); + +$stmt = $db->prepare('SELECT s FROM t ORDER BY s COLLATE CB'); +$res = $stmt->execute(); +while ($row = $res->fetchArray(SQLITE3_NUM)) { + echo $row[0], "\n"; +} +$res->finalize(); +var_dump($db->close()); +echo "done\n"; +?> +--EXPECT-- +Error: Cannot close SQLite3 database while inside a callback +a +b +bool(true) +done From 041b57689d7cbfef4aa4ba89e47b0848ad9c8964 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 16 Sep 2026 15:19:10 +0200 Subject: [PATCH 6/7] standard: Improve `sprintf()` error message when providing an empty arg specifier (#23706) I misremembered the correct syntax for specifying the argnum in an `sprintf()` format string and placed the number after the `$` instead of before. This lead to `sprintf()` seeing an empty number and reporting: > Argument number specifier must be greater than zero and less than 2147483647 which was misleading. Had the error message shown that the argnum is empty, it would have been much clearer that it expect the number before the `$`. --- ext/standard/formatted_print.c | 5 +++++ ext/standard/tests/strings/bug69751.phpt | 2 +- ext/standard/tests/strings/vfprintf_error4.phpt | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c index f35d196fb971..f5ac2ce58456 100644 --- a/ext/standard/formatted_print.c +++ b/ext/standard/formatted_print.c @@ -379,6 +379,11 @@ int php_sprintf_get_argnum(char **format, size_t *format_len) { return ARG_NUM_NEXT; } + if (UNEXPECTED(temppos == *format)) { + zend_value_error("Argument number specifier must not be empty"); + return ARG_NUM_INVALID; + } + int argnum = php_sprintf_getnumber(format, format_len); if (argnum <= 0) { zend_value_error("Argument number specifier must be greater than zero and less than %d", INT_MAX); diff --git a/ext/standard/tests/strings/bug69751.phpt b/ext/standard/tests/strings/bug69751.phpt index f75af897e0e5..0820142d304f 100644 --- a/ext/standard/tests/strings/bug69751.phpt +++ b/ext/standard/tests/strings/bug69751.phpt @@ -23,6 +23,6 @@ try { ?> --EXPECTF-- -Argument number specifier must be greater than zero and less than %d +Argument number specifier must not be empty 4 arguments are required, 3 given Argument number specifier must be greater than zero and less than %d diff --git a/ext/standard/tests/strings/vfprintf_error4.phpt b/ext/standard/tests/strings/vfprintf_error4.phpt index 7c4578ee4090..ac938c1ad609 100644 --- a/ext/standard/tests/strings/vfprintf_error4.phpt +++ b/ext/standard/tests/strings/vfprintf_error4.phpt @@ -35,4 +35,4 @@ 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. +Error found: Argument number specifier must not be empty. From 938a3110bf3a2f978628f1d1ba466308ac012e11 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Wed, 16 Sep 2026 15:12:05 +0100 Subject: [PATCH 7/7] Zend: deprecate is and let as identifiers (#23709) RFCs: - https://wiki.php.net/rfc/deprecations_php_8_6#deprecate_using_let_as_an_identifier - https://wiki.php.net/rfc/deprecations_php_8_6#deprecate_using_is_as_an_identifier --- .../asymmetric_visibility/variation.phpt | 14 +++++----- .../variation_nested.phpt | 8 +++--- .../is/class_alias.phpt | 14 ++++++++++ .../is/class_as_name.phpt | 18 ++++++++++++ .../is/class_as_name_use.phpt | 18 ++++++++++++ .../is/constant_as_name.phpt | 28 +++++++++++++++++++ .../is/constant_as_name_use.phpt | 18 ++++++++++++ .../is/function_as_name.phpt | 18 ++++++++++++ .../is/function_as_name_use.phpt | 18 ++++++++++++ .../let/class_alias.phpt | 14 ++++++++++ .../let/class_as_name.phpt | 18 ++++++++++++ .../let/class_as_name_use.phpt | 18 ++++++++++++ .../let/constant_as_name.phpt | 28 +++++++++++++++++++ .../let/constant_as_name_use.phpt | 18 ++++++++++++ .../let/function_as_name.phpt | 18 ++++++++++++ .../let/function_as_name_use.phpt | 18 ++++++++++++ .../readonly/function_as_name.phpt | 18 ++++++++++++ .../readonly/function_as_name_use.phpt | 16 +++++++++++ .../readonly_as_fn_name_is_deprecated.phpt | 2 +- ...y_as_fn_name_is_deprecated_namespaced.phpt | 2 +- ...s_fn_name_is_deprecated_throw_handler.phpt | 2 +- Zend/tests/grammar/readonly_function.phpt | 2 +- Zend/tests/readonly_props/variation.phpt | 14 +++++----- .../readonly_props/variation_nested.phpt | 8 +++--- Zend/zend_compile.c | 26 +++++++++++++---- Zend/zend_constants.c | 10 ++++--- 26 files changed, 351 insertions(+), 35 deletions(-) create mode 100644 Zend/tests/deprecated_identifiers/is/class_alias.phpt create mode 100644 Zend/tests/deprecated_identifiers/is/class_as_name.phpt create mode 100644 Zend/tests/deprecated_identifiers/is/class_as_name_use.phpt create mode 100644 Zend/tests/deprecated_identifiers/is/constant_as_name.phpt create mode 100644 Zend/tests/deprecated_identifiers/is/constant_as_name_use.phpt create mode 100644 Zend/tests/deprecated_identifiers/is/function_as_name.phpt create mode 100644 Zend/tests/deprecated_identifiers/is/function_as_name_use.phpt create mode 100644 Zend/tests/deprecated_identifiers/let/class_alias.phpt create mode 100644 Zend/tests/deprecated_identifiers/let/class_as_name.phpt create mode 100644 Zend/tests/deprecated_identifiers/let/class_as_name_use.phpt create mode 100644 Zend/tests/deprecated_identifiers/let/constant_as_name.phpt create mode 100644 Zend/tests/deprecated_identifiers/let/constant_as_name_use.phpt create mode 100644 Zend/tests/deprecated_identifiers/let/function_as_name.phpt create mode 100644 Zend/tests/deprecated_identifiers/let/function_as_name_use.phpt create mode 100644 Zend/tests/deprecated_identifiers/readonly/function_as_name.phpt create mode 100644 Zend/tests/deprecated_identifiers/readonly/function_as_name_use.phpt rename Zend/tests/{functions => deprecated_identifiers/readonly}/readonly_as_fn_name_is_deprecated.phpt (58%) rename Zend/tests/{functions => deprecated_identifiers/readonly}/readonly_as_fn_name_is_deprecated_namespaced.phpt (61%) rename Zend/tests/{functions => deprecated_identifiers/readonly}/readonly_as_fn_name_is_deprecated_throw_handler.phpt (79%) diff --git a/Zend/tests/asymmetric_visibility/variation.phpt b/Zend/tests/asymmetric_visibility/variation.phpt index 03cac375f712..7c49da3739f7 100644 --- a/Zend/tests/asymmetric_visibility/variation.phpt +++ b/Zend/tests/asymmetric_visibility/variation.phpt @@ -31,7 +31,7 @@ class Test { echo 'done'; } - public function is() { + public function is_set() { echo (int) isset($this->prop); } @@ -65,7 +65,7 @@ function im($test) { echo 'done'; } -function is($test) { +function is_set($test) { echo (int) isset($test->prop); } @@ -81,7 +81,7 @@ function us_dim($test) { foreach ([true, false] as $init) { foreach ([true, false] as $scope) { - foreach (['r', 'w', 'rw', 'im', 'is', 'us', 'us_dim'] as $op) { + foreach (['r', 'w', 'rw', 'im', 'is_set', 'us', 'us_dim'] as $op) { $test = new Test(); if ($init) { $test->init(); @@ -108,27 +108,27 @@ Init: 1, scope: 1, op: r: 1 Init: 1, scope: 1, op: w: done Init: 1, scope: 1, op: rw: done Init: 1, scope: 1, op: im: done -Init: 1, scope: 1, op: is: 1 +Init: 1, scope: 1, op: is_set: 1 Init: 1, scope: 1, op: us: done Init: 1, scope: 1, op: us_dim: done Init: 1, scope: 0, op: r: 1 Init: 1, scope: 0, op: w: Cannot modify private(set) property Test::$prop from global scope Init: 1, scope: 0, op: rw: Cannot modify private(set) property Test::$prop from global scope Init: 1, scope: 0, op: im: Cannot indirectly modify private(set) property Test::$array from global scope -Init: 1, scope: 0, op: is: 1 +Init: 1, scope: 0, op: is_set: 1 Init: 1, scope: 0, op: us: Cannot unset private(set) property Test::$prop from global scope Init: 1, scope: 0, op: us_dim: Cannot indirectly modify private(set) property Test::$array from global scope Init: 0, scope: 1, op: r: Typed property Test::$prop must not be accessed before initialization Init: 0, scope: 1, op: w: done Init: 0, scope: 1, op: rw: Typed property Test::$prop must not be accessed before initialization Init: 0, scope: 1, op: im: done -Init: 0, scope: 1, op: is: 0 +Init: 0, scope: 1, op: is_set: 0 Init: 0, scope: 1, op: us: done Init: 0, scope: 1, op: us_dim: done Init: 0, scope: 0, op: r: Typed property Test::$prop must not be accessed before initialization Init: 0, scope: 0, op: w: Cannot modify private(set) property Test::$prop from global scope Init: 0, scope: 0, op: rw: Typed property Test::$prop must not be accessed before initialization Init: 0, scope: 0, op: im: Cannot indirectly modify private(set) property Test::$array from global scope -Init: 0, scope: 0, op: is: 0 +Init: 0, scope: 0, op: is_set: 0 Init: 0, scope: 0, op: us: Cannot unset private(set) property Test::$prop from global scope Init: 0, scope: 0, op: us_dim: done diff --git a/Zend/tests/asymmetric_visibility/variation_nested.phpt b/Zend/tests/asymmetric_visibility/variation_nested.phpt index c1dc753a944f..b38b3a1f30a1 100644 --- a/Zend/tests/asymmetric_visibility/variation_nested.phpt +++ b/Zend/tests/asymmetric_visibility/variation_nested.phpt @@ -35,7 +35,7 @@ function im($test) { echo 'done'; } -function is($test) { +function is_set($test) { echo (int) isset($test->prop->prop); } @@ -50,7 +50,7 @@ function us_dim($test) { } foreach ([true, false] as $init) { - foreach (['r', 'w', 'rw', 'im', 'is', 'us', 'us_dim'] as $op) { + foreach (['r', 'w', 'rw', 'im', 'is_set', 'us', 'us_dim'] as $op) { $test = new Test(); if ($init) { $test->init(); @@ -72,13 +72,13 @@ Init: 1, op: r: 1 Init: 1, op: w: done Init: 1, op: rw: done Init: 1, op: im: done -Init: 1, op: is: 1 +Init: 1, op: is_set: 1 Init: 1, op: us: done Init: 1, op: us_dim: done Init: 0, op: r: Typed property Test::$prop must not be accessed before initialization Init: 0, op: w: Cannot indirectly modify private(set) property Test::$prop from global scope Init: 0, op: rw: Typed property Test::$prop must not be accessed before initialization Init: 0, op: im: Cannot indirectly modify private(set) property Test::$prop from global scope -Init: 0, op: is: 0 +Init: 0, op: is_set: 0 Init: 0, op: us: done Init: 0, op: us_dim: done diff --git a/Zend/tests/deprecated_identifiers/is/class_alias.phpt b/Zend/tests/deprecated_identifiers/is/class_alias.phpt new file mode 100644 index 000000000000..12e9687ec259 --- /dev/null +++ b/Zend/tests/deprecated_identifiers/is/class_alias.phpt @@ -0,0 +1,14 @@ +--TEST-- +Using "is" as a class name alias is deprecated +--FILE-- + +--EXPECTF-- +Deprecated: Using "is" as a class alias is deprecated since 8.6 in %s on line %d + +Deprecated: Using "is" as a class alias is deprecated since 8.6 in %s on line %d diff --git a/Zend/tests/deprecated_identifiers/is/class_as_name.phpt b/Zend/tests/deprecated_identifiers/is/class_as_name.phpt new file mode 100644 index 000000000000..d6903294267c --- /dev/null +++ b/Zend/tests/deprecated_identifiers/is/class_as_name.phpt @@ -0,0 +1,18 @@ +--TEST-- +Using "is" as a class name is deprecated +--FILE-- + +--EXPECTF-- +Deprecated: Using "is" as a class name is deprecated since 8.6 in %s on line %d + +Deprecated: Using "is" as a class name is deprecated since 8.6 in %s on line %d diff --git a/Zend/tests/deprecated_identifiers/is/class_as_name_use.phpt b/Zend/tests/deprecated_identifiers/is/class_as_name_use.phpt new file mode 100644 index 000000000000..e1711c5cddd9 --- /dev/null +++ b/Zend/tests/deprecated_identifiers/is/class_as_name_use.phpt @@ -0,0 +1,18 @@ +--TEST-- +Using "is" as a class name in use statements is deprecated +--FILE-- + +--EXPECTF-- +Deprecated: Using "is" as a class name is deprecated in %s on line %d + +Deprecated: Using "is" as a class name is deprecated in %s on line %d diff --git a/Zend/tests/deprecated_identifiers/is/constant_as_name.phpt b/Zend/tests/deprecated_identifiers/is/constant_as_name.phpt new file mode 100644 index 000000000000..9aa13d15f31f --- /dev/null +++ b/Zend/tests/deprecated_identifiers/is/constant_as_name.phpt @@ -0,0 +1,28 @@ +--TEST-- +Using "is" as a constant name is deprecated +--FILE-- + +--EXPECTF-- +Deprecated: Calling a constant "is" is deprecated since 8.6 in %s on line %d + +Deprecated: Calling a constant "is" is deprecated since 8.6 in %s on line %d + +Deprecated: Calling a constant "is" is deprecated since 8.6 in %s on line %d + +Warning: Constant is already defined, this will be an error in PHP 9 in %s on line %d + +Deprecated: Calling a constant "is" is deprecated since 8.6 in %s on line %d diff --git a/Zend/tests/deprecated_identifiers/is/constant_as_name_use.phpt b/Zend/tests/deprecated_identifiers/is/constant_as_name_use.phpt new file mode 100644 index 000000000000..34d4728430dc --- /dev/null +++ b/Zend/tests/deprecated_identifiers/is/constant_as_name_use.phpt @@ -0,0 +1,18 @@ +--TEST-- +Using "is" as a constant in use statements is deprecated +--FILE-- + +--EXPECTF-- +Deprecated: Using "is" as a constant name is deprecated since 8.6 in %s on line %d + +Deprecated: Using "is" as a constant name is deprecated since 8.6 in %s on line %d diff --git a/Zend/tests/deprecated_identifiers/is/function_as_name.phpt b/Zend/tests/deprecated_identifiers/is/function_as_name.phpt new file mode 100644 index 000000000000..5d57bb7a28fa --- /dev/null +++ b/Zend/tests/deprecated_identifiers/is/function_as_name.phpt @@ -0,0 +1,18 @@ +--TEST-- +Using "is" as a function name is deprecated +--FILE-- + +--EXPECTF-- +Deprecated: Calling a function "is" is deprecated since 8.6 in %s on line %d + +Deprecated: Calling a function "is" is deprecated since 8.6 in %s on line %d diff --git a/Zend/tests/deprecated_identifiers/is/function_as_name_use.phpt b/Zend/tests/deprecated_identifiers/is/function_as_name_use.phpt new file mode 100644 index 000000000000..008260f3fa6e --- /dev/null +++ b/Zend/tests/deprecated_identifiers/is/function_as_name_use.phpt @@ -0,0 +1,18 @@ +--TEST-- +Using "is" as a function in use statements is deprecated +--FILE-- + +--EXPECTF-- +Deprecated: Using "is" as a function name is deprecated since 8.6 in %s on line %d + +Deprecated: Using "is" as a function name is deprecated since 8.6 in %s on line %d diff --git a/Zend/tests/deprecated_identifiers/let/class_alias.phpt b/Zend/tests/deprecated_identifiers/let/class_alias.phpt new file mode 100644 index 000000000000..087645bfabfb --- /dev/null +++ b/Zend/tests/deprecated_identifiers/let/class_alias.phpt @@ -0,0 +1,14 @@ +--TEST-- +Using "let" as a class name alias is deprecated +--FILE-- + +--EXPECTF-- +Deprecated: Using "let" as a class alias is deprecated since 8.6 in %s on line %d + +Deprecated: Using "let" as a class alias is deprecated since 8.6 in %s on line %d diff --git a/Zend/tests/deprecated_identifiers/let/class_as_name.phpt b/Zend/tests/deprecated_identifiers/let/class_as_name.phpt new file mode 100644 index 000000000000..ddd96cd1ee16 --- /dev/null +++ b/Zend/tests/deprecated_identifiers/let/class_as_name.phpt @@ -0,0 +1,18 @@ +--TEST-- +Using "let" as a class name is deprecated +--FILE-- + +--EXPECTF-- +Deprecated: Using "let" as a class name is deprecated since 8.6 in %s on line %d + +Deprecated: Using "let" as a class name is deprecated since 8.6 in %s on line %d diff --git a/Zend/tests/deprecated_identifiers/let/class_as_name_use.phpt b/Zend/tests/deprecated_identifiers/let/class_as_name_use.phpt new file mode 100644 index 000000000000..040261d4383e --- /dev/null +++ b/Zend/tests/deprecated_identifiers/let/class_as_name_use.phpt @@ -0,0 +1,18 @@ +--TEST-- +Using "let" as a class name in use statements is deprecated +--FILE-- + +--EXPECTF-- +Deprecated: Using "let" as a class name is deprecated in %s on line %d + +Deprecated: Using "let" as a class name is deprecated in %s on line %d diff --git a/Zend/tests/deprecated_identifiers/let/constant_as_name.phpt b/Zend/tests/deprecated_identifiers/let/constant_as_name.phpt new file mode 100644 index 000000000000..a276ffecf63f --- /dev/null +++ b/Zend/tests/deprecated_identifiers/let/constant_as_name.phpt @@ -0,0 +1,28 @@ +--TEST-- +Using "let" as a constant name is deprecated +--FILE-- + +--EXPECTF-- +Deprecated: Calling a constant "let" is deprecated since 8.6 in %s on line %d + +Deprecated: Calling a constant "let" is deprecated since 8.6 in %s on line %d + +Deprecated: Calling a constant "let" is deprecated since 8.6 in %s on line %d + +Warning: Constant let already defined, this will be an error in PHP 9 in %s on line %d + +Deprecated: Calling a constant "let" is deprecated since 8.6 in %s on line %d diff --git a/Zend/tests/deprecated_identifiers/let/constant_as_name_use.phpt b/Zend/tests/deprecated_identifiers/let/constant_as_name_use.phpt new file mode 100644 index 000000000000..fab6fb0db7d3 --- /dev/null +++ b/Zend/tests/deprecated_identifiers/let/constant_as_name_use.phpt @@ -0,0 +1,18 @@ +--TEST-- +Using "let" as a constant in use statements is deprecated +--FILE-- + +--EXPECTF-- +Deprecated: Using "let" as a constant name is deprecated since 8.6 in %s on line %d + +Deprecated: Using "let" as a constant name is deprecated since 8.6 in %s on line %d diff --git a/Zend/tests/deprecated_identifiers/let/function_as_name.phpt b/Zend/tests/deprecated_identifiers/let/function_as_name.phpt new file mode 100644 index 000000000000..c37f11007fa7 --- /dev/null +++ b/Zend/tests/deprecated_identifiers/let/function_as_name.phpt @@ -0,0 +1,18 @@ +--TEST-- +Using "let" as a function name is deprecated +--FILE-- + +--EXPECTF-- +Deprecated: Calling a function "let" is deprecated since 8.6 in %s on line %d + +Deprecated: Calling a function "let" is deprecated since 8.6 in %s on line %d diff --git a/Zend/tests/deprecated_identifiers/let/function_as_name_use.phpt b/Zend/tests/deprecated_identifiers/let/function_as_name_use.phpt new file mode 100644 index 000000000000..7dc501ea7036 --- /dev/null +++ b/Zend/tests/deprecated_identifiers/let/function_as_name_use.phpt @@ -0,0 +1,18 @@ +--TEST-- +Using "let" as a function in use statements is deprecated +--FILE-- + +--EXPECTF-- +Deprecated: Using "let" as a function name is deprecated since 8.6 in %s on line %d + +Deprecated: Using "let" as a function name is deprecated since 8.6 in %s on line %d diff --git a/Zend/tests/deprecated_identifiers/readonly/function_as_name.phpt b/Zend/tests/deprecated_identifiers/readonly/function_as_name.phpt new file mode 100644 index 000000000000..9c15743e5f0b --- /dev/null +++ b/Zend/tests/deprecated_identifiers/readonly/function_as_name.phpt @@ -0,0 +1,18 @@ +--TEST-- +Using "readonly" as a function name readonly is deprecated +--FILE-- + +--EXPECTF-- +Deprecated: Calling a function "readonly" is deprecated since 8.6 in %s on line %d + +Deprecated: Calling a function "readonly" is deprecated since 8.6 in %s on line %d diff --git a/Zend/tests/deprecated_identifiers/readonly/function_as_name_use.phpt b/Zend/tests/deprecated_identifiers/readonly/function_as_name_use.phpt new file mode 100644 index 000000000000..b8f7a6dd2704 --- /dev/null +++ b/Zend/tests/deprecated_identifiers/readonly/function_as_name_use.phpt @@ -0,0 +1,16 @@ +--TEST-- +Using "readonly" as a function in use statements was never supported +--FILE-- + +--EXPECTF-- +Parse error: syntax error, unexpected token "readonly", expecting identifier in %s on line %d diff --git a/Zend/tests/functions/readonly_as_fn_name_is_deprecated.phpt b/Zend/tests/deprecated_identifiers/readonly/readonly_as_fn_name_is_deprecated.phpt similarity index 58% rename from Zend/tests/functions/readonly_as_fn_name_is_deprecated.phpt rename to Zend/tests/deprecated_identifiers/readonly/readonly_as_fn_name_is_deprecated.phpt index 2ac975dcf654..4a53a98b1041 100644 --- a/Zend/tests/functions/readonly_as_fn_name_is_deprecated.phpt +++ b/Zend/tests/deprecated_identifiers/readonly/readonly_as_fn_name_is_deprecated.phpt @@ -8,5 +8,5 @@ function readonly() {} ?> DONE --EXPECTF-- -Deprecated: Calling a function “readonly” is deprecated in %s on line %d +Deprecated: Calling a function "readonly" is deprecated since 8.6 in %s on line %d DONE diff --git a/Zend/tests/functions/readonly_as_fn_name_is_deprecated_namespaced.phpt b/Zend/tests/deprecated_identifiers/readonly/readonly_as_fn_name_is_deprecated_namespaced.phpt similarity index 61% rename from Zend/tests/functions/readonly_as_fn_name_is_deprecated_namespaced.phpt rename to Zend/tests/deprecated_identifiers/readonly/readonly_as_fn_name_is_deprecated_namespaced.phpt index f4b39d6c3e5a..b55f84786521 100644 --- a/Zend/tests/functions/readonly_as_fn_name_is_deprecated_namespaced.phpt +++ b/Zend/tests/deprecated_identifiers/readonly/readonly_as_fn_name_is_deprecated_namespaced.phpt @@ -10,5 +10,5 @@ function readonly() {} ?> DONE --EXPECTF-- -Deprecated: Calling a function “readonly” is deprecated in %s on line %d +Deprecated: Calling a function "readonly" is deprecated since 8.6 in %s on line %d DONE diff --git a/Zend/tests/functions/readonly_as_fn_name_is_deprecated_throw_handler.phpt b/Zend/tests/deprecated_identifiers/readonly/readonly_as_fn_name_is_deprecated_throw_handler.phpt similarity index 79% rename from Zend/tests/functions/readonly_as_fn_name_is_deprecated_throw_handler.phpt rename to Zend/tests/deprecated_identifiers/readonly/readonly_as_fn_name_is_deprecated_throw_handler.phpt index 428bd339d111..4681ccd06189 100644 --- a/Zend/tests/functions/readonly_as_fn_name_is_deprecated_throw_handler.phpt +++ b/Zend/tests/deprecated_identifiers/readonly/readonly_as_fn_name_is_deprecated_throw_handler.phpt @@ -13,5 +13,5 @@ function readonly() {} ?> DONE --EXPECTF-- -Deprecated: Calling a function “readonly” is deprecated in %s on line %d +Deprecated: Calling a function "readonly" is deprecated since 8.6 in %s on line %d DONE diff --git a/Zend/tests/grammar/readonly_function.phpt b/Zend/tests/grammar/readonly_function.phpt index c1592aa1fe8c..30dc3d41eb3c 100644 --- a/Zend/tests/grammar/readonly_function.phpt +++ b/Zend/tests/grammar/readonly_function.phpt @@ -33,7 +33,7 @@ echo $b->readonly, "\n"; ?> --EXPECTF-- -Deprecated: Calling a function “readonly” is deprecated in %s on line %d +Deprecated: Calling a function "readonly" is deprecated since 8.6 in %s on line %d Hi! Const hi! Static hi! diff --git a/Zend/tests/readonly_props/variation.phpt b/Zend/tests/readonly_props/variation.phpt index 420eec8705dc..32291d7a0908 100644 --- a/Zend/tests/readonly_props/variation.phpt +++ b/Zend/tests/readonly_props/variation.phpt @@ -31,7 +31,7 @@ class Test { echo 'done'; } - public function is() { + public function is_set() { echo (int) isset($this->prop); } @@ -65,7 +65,7 @@ function im($test) { echo 'done'; } -function is($test) { +function is_set($test) { echo (int) isset($test->prop); } @@ -81,7 +81,7 @@ function us_dim($test) { foreach ([true, false] as $init) { foreach ([true, false] as $scope) { - foreach (['r', 'w', 'rw', 'im', 'is', 'us', 'us_dim'] as $op) { + foreach (['r', 'w', 'rw', 'im', 'is_set', 'us', 'us_dim'] as $op) { $test = new Test(); if ($init) { $test->init(); @@ -108,27 +108,27 @@ Init: 1, scope: 1, op: r: 1 Init: 1, scope: 1, op: w: Cannot modify readonly property Test::$prop Init: 1, scope: 1, op: rw: Cannot modify readonly property Test::$prop Init: 1, scope: 1, op: im: Cannot indirectly modify readonly property Test::$prop -Init: 1, scope: 1, op: is: 1 +Init: 1, scope: 1, op: is_set: 1 Init: 1, scope: 1, op: us: Cannot unset readonly property Test::$prop Init: 1, scope: 1, op: us_dim: Cannot indirectly modify readonly property Test::$array Init: 1, scope: 0, op: r: 1 Init: 1, scope: 0, op: w: Cannot modify readonly property Test::$prop Init: 1, scope: 0, op: rw: Cannot modify readonly property Test::$prop Init: 1, scope: 0, op: im: Cannot indirectly modify readonly property Test::$prop -Init: 1, scope: 0, op: is: 1 +Init: 1, scope: 0, op: is_set: 1 Init: 1, scope: 0, op: us: Cannot unset readonly property Test::$prop Init: 1, scope: 0, op: us_dim: Cannot indirectly modify readonly property Test::$array Init: 0, scope: 1, op: r: Typed property Test::$prop must not be accessed before initialization Init: 0, scope: 1, op: w: done Init: 0, scope: 1, op: rw: Typed property Test::$prop must not be accessed before initialization Init: 0, scope: 1, op: im: Cannot indirectly modify readonly property Test::$prop -Init: 0, scope: 1, op: is: 0 +Init: 0, scope: 1, op: is_set: 0 Init: 0, scope: 1, op: us: done Init: 0, scope: 1, op: us_dim: done Init: 0, scope: 0, op: r: Typed property Test::$prop must not be accessed before initialization Init: 0, scope: 0, op: w: Cannot modify protected(set) readonly property Test::$prop from global scope Init: 0, scope: 0, op: rw: Typed property Test::$prop must not be accessed before initialization Init: 0, scope: 0, op: im: Cannot indirectly modify readonly property Test::$prop -Init: 0, scope: 0, op: is: 0 +Init: 0, scope: 0, op: is_set: 0 Init: 0, scope: 0, op: us: Cannot unset protected(set) readonly property Test::$prop from global scope Init: 0, scope: 0, op: us_dim: done diff --git a/Zend/tests/readonly_props/variation_nested.phpt b/Zend/tests/readonly_props/variation_nested.phpt index 31608afcc2ce..241bfb7c8924 100644 --- a/Zend/tests/readonly_props/variation_nested.phpt +++ b/Zend/tests/readonly_props/variation_nested.phpt @@ -35,7 +35,7 @@ function im($test) { echo 'done'; } -function is($test) { +function is_set($test) { echo (int) isset($test->prop->prop); } @@ -50,7 +50,7 @@ function us_dim($test) { } foreach ([true, false] as $init) { - foreach (['r', 'w', 'rw', 'im', 'is', 'us', 'us_dim'] as $op) { + foreach (['r', 'w', 'rw', 'im', 'is_set', 'us', 'us_dim'] as $op) { $test = new Test(); if ($init) { $test->init(); @@ -72,13 +72,13 @@ Init: 1, op: r: 1 Init: 1, op: w: done Init: 1, op: rw: done Init: 1, op: im: done -Init: 1, op: is: 1 +Init: 1, op: is_set: 1 Init: 1, op: us: done Init: 1, op: us_dim: done Init: 0, op: r: Typed property Test::$prop must not be accessed before initialization Init: 0, op: w: Cannot indirectly modify readonly property Test::$prop Init: 0, op: rw: Typed property Test::$prop must not be accessed before initialization Init: 0, op: im: Cannot indirectly modify readonly property Test::$prop -Init: 0, op: is: 0 +Init: 0, op: is_set: 0 Init: 0, op: us: done Init: 0, op: us_dim: done diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 5aa1b07f304d..7151d0764faf 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -254,6 +254,10 @@ void zend_assert_valid_class_name(const zend_string *name, const char *type) /* } if (zend_string_equals_literal(name, "_") || zend_string_ends_with_literal(name, "\\_")) { zend_error(E_DEPRECATED, "Using \"_\" as %s is deprecated since 8.4", type); + } else if (zend_string_equals_literal_ci(name, "let") || zend_string_ends_with_literal(name, "\\let")) { + zend_error(E_DEPRECATED, "Using \"let\" as %s is deprecated since 8.6", type); + } else if (zend_string_equals_literal_ci(name, "is") || zend_string_ends_with_literal(name, "\\is")) { + zend_error(E_DEPRECATED, "Using \"is\" as %s is deprecated since 8.6", type); } } /* }}} */ @@ -8952,8 +8956,12 @@ static zend_string *zend_begin_func_decl(znode *result, zend_op_array *op_array, "__autoload() is no longer supported, use spl_autoload_register() instead"); } - if (zend_string_equals_literal_ci(unqualified_name, "readonly")) { - zend_error(E_DEPRECATED, "Calling a function “readonly” is deprecated"); + if ( + zend_string_equals_literal_ci(unqualified_name, "readonly") + || zend_string_equals_literal_ci(unqualified_name, "let") + || zend_string_equals_literal_ci(unqualified_name, "is") + ) { + zend_error(E_DEPRECATED, "Calling a function \"%pS\" is deprecated since 8.6", unqualified_name); } if (zend_string_equals_literal_ci(unqualified_name, "assert")) { @@ -10213,15 +10221,23 @@ static void zend_compile_use(zend_ast *ast) /* {{{ */ "is a special class name", ZSTR_VAL(old_name), ZSTR_VAL(new_name), ZSTR_VAL(new_name)); } - if (zend_string_equals(new_name, ZSTR_CHAR('_'))) { + if ( + zend_string_equals(new_name, ZSTR_CHAR('_')) + || zend_string_equals_literal_ci(new_name, "let") + || zend_string_equals_literal_ci(new_name, "is") + ) { switch (type) { case ZEND_SYMBOL_CLASS: - zend_error(E_DEPRECATED, "Using \"_\" as a class name is deprecated"); + zend_error(E_DEPRECATED, "Using \"%pS\" as a class name is deprecated", new_name); break; case ZEND_SYMBOL_CONST: - zend_error(E_DEPRECATED, "Using \"_\" as a constant name is deprecated since 8.6"); + zend_error(E_DEPRECATED, "Using \"%pS\" as a constant name is deprecated since 8.6", new_name); break; case ZEND_SYMBOL_FUNCTION: + if (zend_string_equals(new_name, ZSTR_CHAR('_'))) { + break; + } + zend_error(E_DEPRECATED, "Using \"%pS\" as a function name is deprecated since 8.6", new_name); break; default: ZEND_UNREACHABLE(); } diff --git a/Zend/zend_constants.c b/Zend/zend_constants.c index c8a2ae62d756..6f50c59641c2 100644 --- a/Zend/zend_constants.c +++ b/Zend/zend_constants.c @@ -538,12 +538,14 @@ ZEND_API zend_constant *zend_register_constant(zend_constant *c) c->attributes = NULL; - if ( - zend_string_equals(name, ZSTR_CHAR('_')) - || (slash && zend_string_ends_with_literal(name, "\\_")) - ) { + if (zend_string_equals(name, ZSTR_CHAR('_')) || zend_string_ends_with_literal(name, "\\_")) { zend_error(E_DEPRECATED, "Calling a constant \"_\" is deprecated since 8.6"); + } else if (zend_string_equals_literal_ci(name, "let") || zend_string_ends_with_literal(name, "\\let")) { + zend_error(E_DEPRECATED, "Calling a constant \"let\" is deprecated since 8.6"); + } else if (zend_string_equals_literal_ci(name, "is") || zend_string_ends_with_literal(name, "\\is")) { + zend_error(E_DEPRECATED, "Calling a constant \"is\" is deprecated since 8.6"); } + /* Check if the user is trying to define any special constant */ if (zend_string_equals_literal(name, "__COMPILER_HALT_OFFSET__") || (!persistent && zend_get_special_const(ZSTR_VAL(name), ZSTR_LEN(name)))