Skip to content

RFC: Deprecate type juggling to and from bool for function type juggling context #18879

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 38 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
be5368a
Zend/zend_execute: make some functions private
Girgias Jun 19, 2025
6674845
Deprecate type juggling to/from bool for function context
Girgias Jun 19, 2025
7f46548
Fix run-tests
Girgias Jul 1, 2025
6bdd8f6
fix some tests
Girgias Jun 19, 2025
fd57f96
Fix
Girgias Jun 20, 2025
efa5b72
tests: Fix tests affected by bool type juggling deprecation
Girgias Jun 20, 2025
3c5514f
ext/date: Fix tests
Girgias Jun 20, 2025
18ed668
ext/phar: Fix tests [WIP]
Girgias Jun 20, 2025
e92ed23
ext/reflection: Remove ZPP tests and use bool
Girgias Jun 20, 2025
c3593e6
ext/standard/tests/array: Fix tests and remove ZPP tests
Girgias Jun 20, 2025
22c05f6
ext/standard/tests/file: Fix tests and remove ZPP tests
Girgias Jun 20, 2025
fe2b149
ext/standard/tests/general_functions: Fix tests and remove ZPP tests
Girgias Jun 21, 2025
b803a47
ext/standard/tests/http: Fix tests
Girgias Jun 21, 2025
15d89dd
ext/standard/tests/math: Fix tests and remove ZPP tests
Girgias Jun 21, 2025
7d21d73
ext/standard/tests/misc: Fix tests
Girgias Jun 21, 2025
6ea2a4e
ext/standard/tests/network: Fix tests
Girgias Jun 21, 2025
cda9234
ext/standard/tests/url: Fix tests
Girgias Jun 21, 2025
8c78400
ext/standard/tests/streams: Fix tests
Girgias Jun 21, 2025
b76cf4e
ext/standard/tests/strings: W.I.P. Fix tests and remove ZPP tests
Girgias Jun 21, 2025
d942130
ext/json: Remove bool type coercions in tests
Girgias Jun 21, 2025
5a68bd4
ext/posix: Fix manual ZPP tests
Girgias Jun 23, 2025
eb39385
sapi/cli: Remove bool type coercions in tests
Girgias Jun 23, 2025
3a6984e
ext/gd: Remove bool type coercions in tests and ZPP tests
Girgias Jun 24, 2025
6ab02a9
ext/iconv: Remove bool type coercions in tests
Girgias Jun 24, 2025
e541e6b
ext/curl: Remove bool type coercions in tests
Girgias Jun 24, 2025
6c29261
ext/openssl: Remove bool type coercions in tests
Girgias Jun 24, 2025
91fa608
ext/intl: Remove bool type coercions in tests
Girgias Jun 24, 2025
71cfd2c
ext/intl: Fix tests
Girgias Jun 24, 2025
5b8c837
Fix FPM?
Girgias Jun 24, 2025
9cf851e
mbstring fix
Girgias Jun 24, 2025
f1bd5bf
image fix
Girgias Jun 24, 2025
a0b1f30
ext/gettext: Remove bool type coercions in tests
Girgias Jun 24, 2025
8417c2a
ext/pdo_dblib: Remove bool type coercions in tests
Girgias Jun 24, 2025
8acff1b
ext/pdo_pgsql: Remove bool type coercions in tests
Girgias Jun 24, 2025
c251952
ext/mysqli: Remove bool type coercions in tests
Girgias Jun 24, 2025
10cbc92
ext/snmp: Remove bool type coercions in tests
Girgias Jun 24, 2025
27566c5
Sockets win
Girgias Jun 25, 2025
e1a3dc6
Add deprecation to EXPECTF temporarily for Zend test that relies on S…
Girgias Jul 1, 2025
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ext/standard/tests/strings: W.I.P. Fix tests and remove ZPP tests
  • Loading branch information
Girgias committed Jul 1, 2025
commit b76cf4ea6ccd739b072f75a5955f9900d76752d3
2 changes: 1 addition & 1 deletion ext/standard/tests/strings/bug20927.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ $linelength = 10;
echo "Length of original string: ".strlen($string)."\n";
echo "Length of break string: ".strlen($break)."\n";

var_dump(wordwrap($string, $linelength, $break, 1));
var_dump(wordwrap($string, $linelength, $break, true));
?>
--EXPECT--
Length of original string: 130
Expand Down
2 changes: 1 addition & 1 deletion ext/standard/tests/strings/bug33605.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Bug #33605 (substr_compare crashes)
--FILE--
<?php
try {
substr_compare("aa", "a", -99999999, -1, 0);
substr_compare("aa", "a", -99999999, -1, false);
} catch (\ValueError $e) {
echo $e->getMessage();
}
Expand Down
2 changes: 0 additions & 2 deletions ext/standard/tests/strings/chop_variation5.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ echo "*** Testing chop() : with miscellaneous arguments ***\n";

var_dump ( chop("chop test \t\0 ") ); /* without second Argument */
var_dump ( chop("chop test " , "") ); /* no characters in second Argument */
var_dump ( chop("chop test ", true) ); /* with boolean value as second Argument */
var_dump ( chop("chop test ", " ") ); /* with single space as second Argument */
var_dump ( chop("chop test \t\n\r\0\x0B", "\t\n\r\0\x0B") ); /* with multiple escape sequences as second Argument */
var_dump ( chop("chop testABCXYZ", "A..Z") ); /* with characters range as second Argument */
Expand All @@ -23,7 +22,6 @@ echo "Done\n";
*** Testing chop() : with miscellaneous arguments ***
string(9) "chop test"
string(12) "chop test "
string(17) "chop test "
string(9) "chop test"
string(10) "chop test "
string(9) "chop test"
Expand Down
77 changes: 0 additions & 77 deletions ext/standard/tests/strings/chr_variation1.phpt

This file was deleted.

28 changes: 8 additions & 20 deletions ext/standard/tests/strings/implode_variation.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,15 @@ $pieces = array(
2,
0,
-639,
true,
"PHP",
false,
"",
" ",
"string\x00with\x00...\0"
);
$glues = array(
"TRUE",
true,
false,
array("key1", "key2"),
"",
" ",
"string\x00between",
-0,
'\0'
);
Expand Down Expand Up @@ -179,23 +173,17 @@ array(1) {

*** Testing implode() with variations of glue ***
-- Iteration 1 --
string(59) "2TRUE0TRUE-639TRUE1TRUEPHPTRUETRUETRUE TRUEstring%0with%0...%0"
string(30) "2TRUE0TRUE-639TRUEPHPTRUETRUE "
-- Iteration 2 --
string(35) "2101-639111PHP111 1string%0with%0...%0"
implode(): Argument #1 ($separator) must be of type string, array given
-- Iteration 3 --
string(27) "20-6391PHP string%0with%0...%0"
string(10) "20-639PHP "
-- Iteration 4 --
implode(): Argument #1 ($separator) must be of type string, array given
string(15) "2 0 -639 PHP "
-- Iteration 5 --
string(27) "20-6391PHP string%0with%0...%0"
string(15) "2000-6390PHP00 "
-- Iteration 6 --
string(35) "2 0 -639 1 PHP string%0with%0...%0"
-- Iteration 7 --
string(139) "2string%0between0string%0between-639string%0between1string%0betweenPHPstring%0betweenstring%0betweenstring%0between string%0betweenstring%0with%0...%0"
-- Iteration 8 --
string(35) "2000-639010PHP000 0string%0with%0...%0"
-- Iteration 9 --
string(43) "2\00\0-639\01\0PHP\0\0\0 \0string%0with%0...%0"
string(20) "2\00\0-639\0PHP\0\0 "

*** Testing implode() on empty string ***
implode(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given
Expand All @@ -208,9 +196,9 @@ Warning: Array to string conversion in %s on line %d
string(27) "ArrayTESTArrayTESTPHPTEST50"
implode(): Argument #1 ($separator) must be of type string, array given

Warning: Array to string conversion in %s
Warning: Array to string conversion in %s on line %d

Warning: Array to string conversion in %s
Warning: Array to string conversion in %s on line %d
string(18) "Array2Array2PHP250"

*** Testing implode() on objects ***
Expand Down
24 changes: 24 additions & 0 deletions ext/standard/tests/strings/implode_with_null_bytes.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
--TEST--
Test implode() function with strings with null bytes
--FILE--
<?php

$pieces = [
'PHP',
'is',
'great',
];

$glues = [
"\0",
"string\x00between",
];

foreach ($glues as $glue) {
var_dump(implode($glue, $pieces));
}

?>
--EXPECTF--
string(12) "PHP%0is%0great"
string(38) "PHPstring%0betweenisstring%0betweengreat"
133 changes: 0 additions & 133 deletions ext/standard/tests/strings/join_variation1.phpt

This file was deleted.

Loading