Skip to content

Fix #64194: NULL variable (and scalars) do not give error when trying to use as array #1269

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

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions Zend/tests/024.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,23 @@ var_dump($a->$b->{$c[1]});
?>
--EXPECTF--
Notice: Undefined variable: a in %s on line %d

Notice: Trying to get index of a non-array in %s on line 3
NULL

Notice: Undefined variable: %s in %s on line %d
Notice: Undefined variable: a in %s on line %d

Notice: Undefined variable: c in %s on line %d

Notice: Undefined variable: %s in %s on line %d
Notice: Trying to get index of a non-array in %s on line %d
NULL

Notice: Undefined variable: a in %s on line %d
int(1)

Notice: Undefined variable: %s in %s on line %d
Notice: Undefined variable: a in %s on line %d

Notice: Undefined variable: %s in %s on line %d
Notice: Undefined variable: b in %s on line %d
int(0)

Notice: Undefined variable: a in %s on line %d
Expand All @@ -45,6 +49,8 @@ NULL

Notice: Undefined variable: c in %s on line %d

Notice: Trying to get index of a non-array in %s on line 11

Notice: Trying to get property of non-object in %s on line %d

Notice: Trying to get property of non-object in %s on line %d
Expand Down
30 changes: 30 additions & 0 deletions Zend/tests/033.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,40 @@ $arr[][]->bar = 2;

Notice: Undefined variable: arr in %s on line %d

Notice: Trying to get index of a non-array in %s on line 3

Notice: Trying to get index of a non-array in %s on line 3

Notice: Trying to get index of a non-array in %s on line 3

Notice: Trying to get index of a non-array in %s on line 3

Notice: Trying to get index of a non-array in %s on line 3

Notice: Undefined variable: arr in %s on line %d

Notice: Trying to get index of a non-array in %s on line 5

Notice: Trying to get index of a non-array in %s on line 5

Notice: Trying to get index of a non-array in %s on line 5

Notice: Trying to get index of a non-array in %s on line 5

Notice: Trying to get index of a non-array in %s on line 5

Notice: Undefined variable: arr in %s on line %d

Notice: Trying to get index of a non-array in %s on line 7

Notice: Trying to get index of a non-array in %s on line 7

Notice: Trying to get index of a non-array in %s on line 7

Notice: Trying to get index of a non-array in %s on line 7

Notice: Trying to get index of a non-array in %s on line 7

Notice: Trying to get property of non-object in %s on line %d

Warning: Creating default object from empty value in %s on line %d
Expand Down
Loading