Skip to content

Commit

Permalink
nullref fix + tests
Browse files Browse the repository at this point in the history
fixes #1146
  • Loading branch information
jakubmisek committed Jul 27, 2024
1 parent 7e13fcf commit 2e7f402
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Peachpie.CodeAnalysis/Semantics/SemanticsBinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ BoundStatement BindUnsetStmt(AST.UnsetStmt stmt)
{
return new BoundBlock(
stmt.VarList
.WhereNotNull()
.Select(BindUnsetStmt)
.ToList()
);
Expand Down
6 changes: 6 additions & 0 deletions tests/variables/unset_006.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php
namespace variables\unset_006;

$g = 123;
unset($g, ); // null item // https://github.com/peachpiecompiler/peachpie/issues/1146

0 comments on commit 2e7f402

Please sign in to comment.