Skip to content

Commit a6edb99

Browse files
committed
Nits + better illegal string offset message
1 parent 2857e92 commit a6edb99

File tree

12 files changed

+675
-56
lines changed

12 files changed

+675
-56
lines changed

Zend/tests/bug24773.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Bug #24773 (unset() of integers treated as arrays causes a crash)
66
unset($array["lvl1"]["lvl2"]["b"]);
77
?>
88
--EXPECTF--
9-
Fatal error: Uncaught TypeError: Illegal offset type in %s:%d
9+
Fatal error: Uncaught TypeError: Cannot access offset of type string on string in %s:%d
1010
Stack trace:
1111
#0 {main}
1212
thrown in %s on line %d

Zend/tests/bug31098.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ ok
5858

5959
Warning: Attempt to read property "wrong" on string in %s on line %d
6060
ok
61-
Illegal offset type
61+
Cannot access offset of type string on string
6262
ok
63-
Illegal offset type
63+
Cannot access offset of type string on string
6464
ok

Zend/tests/bug53432.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ string(6) " a"
5757
Warning: Illegal string offset -1 in %s on line %d
5858
NULL
5959
string(0) ""
60-
Illegal offset type
60+
Cannot access offset of type string on string
6161
string(1) "a"
6262
Error: [] operator not supported for strings
6363
string(0) ""

Zend/tests/indexing_001.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ array(1) {
7676
}
7777

7878
Warning: Array to string conversion in %s on line %d
79-
Illegal offset type
79+
Cannot access offset of type string on string
8080
string(0) ""
8181

8282
Warning: Array to string conversion in %s on line %d
83-
Illegal offset type
83+
Cannot access offset of type string on string
8484
string(1) " "
8585
Cannot use a scalar value as an array
8686
float(0.1)

Zend/tests/numeric_strings/string_offset.phpt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,29 +39,29 @@ echo "Done\n";
3939
?>
4040
--EXPECTF--
4141
string(1) "l"
42-
Illegal offset type
42+
Cannot access offset of type string on string
4343
string(1) "l"
44-
Illegal offset type
44+
Cannot access offset of type string on string
4545
string(1) "l"
46-
Illegal offset type
46+
Cannot access offset of type string on string
4747
string(1) "l"
48-
Illegal offset type
48+
Cannot access offset of type string on string
4949

5050
Warning: Illegal string offset "7str" in %s on line %d
5151
string(1) "l"
52-
Illegal offset type
52+
Cannot access offset of type string on string
5353

5454
Warning: Illegal string offset " 7str" in %s on line %d
5555
string(1) "l"
56-
Illegal offset type
56+
Cannot access offset of type string on string
5757

5858
Warning: Illegal string offset " 7 str" in %s on line %d
5959
string(1) "l"
60-
Illegal offset type
60+
Cannot access offset of type string on string
6161

6262
Warning: Illegal string offset "7 str" in %s on line %d
6363
string(1) "l"
64-
Illegal offset type
64+
Cannot access offset of type string on string
6565

6666
Warning: Illegal string offset "0xC" in %s on line %d
6767
string(1) "T"

Zend/tests/offset_string.phpt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ string(1) "S"
5555

5656
Warning: String offset cast occurred in %s on line %d
5757
string(1) "S"
58-
Illegal offset type
58+
Cannot access offset of type string on string
5959
string(1) "c"
60-
Illegal offset type
60+
Cannot access offset of type string on string
6161

6262
Warning: Illegal string offset "15 and then some" in %s on line %d
6363
string(1) "r"
@@ -67,9 +67,9 @@ string(1) "i"
6767

6868
Warning: String offset cast occurred in %s on line %d
6969
string(1) "S"
70-
Illegal offset type
70+
Cannot access offset of type resource on string
7171

7272
Notice: Object of class stdClass could not be converted to int in %s on line %d
73-
Illegal offset type
74-
Illegal offset type
73+
Cannot access offset of type stdClass on string
74+
Cannot access offset of type array on string
7575
Done

0 commit comments

Comments
 (0)