Commit 72244e6b20a for php.net

commit 72244e6b20a356dbd1a82f01ab185a52e1167ce4
Author: Diego Sales <diegoasales@gmail.com>
Date:   Tue Jun 2 14:16:40 2026 -0300

    ext/standard: improve explode() error message for empty separator (GH-21906)

diff --git a/ext/standard/string.c b/ext/standard/string.c
index 7ded14366a9..006adc4467d 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -914,7 +914,7 @@ PHP_FUNCTION(explode)
 	ZEND_PARSE_PARAMETERS_END();

 	if (ZSTR_LEN(delim) == 0) {
-		zend_argument_must_not_be_empty_error(1);
+		zend_argument_value_error(1, "must not be empty, use str_split() to split a string into characters");
 		RETURN_THROWS();
 	}

diff --git a/ext/standard/tests/strings/explode.phpt b/ext/standard/tests/strings/explode.phpt
index ea467a2d550..248fade7605 100644
--- a/ext/standard/tests/strings/explode.phpt
+++ b/ext/standard/tests/strings/explode.phpt
@@ -62,9 +62,9 @@
   4 => 'd',
 )
 d6bee42a771449205344c0938ad4f035
-explode(): Argument #1 ($separator) must not be empty
-explode(): Argument #1 ($separator) must not be empty
-explode(): Argument #1 ($separator) must not be empty
+explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
+explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
+explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
 array(1) {
   [0]=>
   string(0) ""
@@ -79,7 +79,7 @@
   [0]=>
   string(0) ""
 }
-explode(): Argument #1 ($separator) must not be empty
+explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
 array(1) {
   [0]=>
   string(3) "acb"
diff --git a/ext/standard/tests/strings/explode1.phpt b/ext/standard/tests/strings/explode1.phpt
index 876b159821c..022654a5764 100644
--- a/ext/standard/tests/strings/explode1.phpt
+++ b/ext/standard/tests/strings/explode1.phpt
@@ -91,15 +91,15 @@ public function __toString() {
 --EXPECT--
 *** Testing explode() for basic operations ***
 -- Iteration 1 --
-explode(): Argument #1 ($separator) must not be empty
-explode(): Argument #1 ($separator) must not be empty
-explode(): Argument #1 ($separator) must not be empty
-explode(): Argument #1 ($separator) must not be empty
+explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
+explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
+explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
+explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
 -- Iteration 2 --
-explode(): Argument #1 ($separator) must not be empty
-explode(): Argument #1 ($separator) must not be empty
-explode(): Argument #1 ($separator) must not be empty
-explode(): Argument #1 ($separator) must not be empty
+explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
+explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
+explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
+explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
 -- Iteration 3 --
 array(1) {
   [0]=>
@@ -201,10 +201,10 @@ public function __toString() {
   string(56) "234NULL23abcd00000TRUEFALSE-11.234444true-11.24%PHP%ZEND"
 }
 -- Iteration 7 --
-explode(): Argument #1 ($separator) must not be empty
-explode(): Argument #1 ($separator) must not be empty
-explode(): Argument #1 ($separator) must not be empty
-explode(): Argument #1 ($separator) must not be empty
+explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
+explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
+explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
+explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters
 -- Iteration 8 --
 array(2) {
   [0]=>