We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 2a693cb + 54f79a1 commit aef1bd4Copy full SHA for aef1bd4
test/unit/CoreTest.php
@@ -79,10 +79,14 @@ public function testOurSubstrOutOfBorders()
79
// See: https://secure.php.net/manual/en/function.mb-substr.php#50275
80
81
// We want to be like substr, so confirm that behavior.
82
- $this->assertSame(
83
- false,
84
- substr('abc', 5, 2)
85
- );
+ if (PHP_VERSION_ID < 80000) {
+ // In PHP 8.0, substr starts returning '' instead of the empty string.
+ // Core::ourSubstr should behave the OLD way.
+ $this->assertSame(
86
+ false,
87
+ substr('abc', 5, 2)
88
+ );
89
+ }
90
91
// Confirm that mb_substr does not have that behavior.
92
if (function_exists('mb_substr')) {
0 commit comments