Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Array after
array_push
/ array_unshift
call can still be empty
- Loading branch information
Showing
5 changed files
with
67 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
namespace Bug7424; | ||
|
||
class Test | ||
{ | ||
public function run(): void | ||
{ | ||
$data = $this->getInitData(); | ||
|
||
array_push($data, ...$this->getExtra()); | ||
|
||
if (empty($data)) { | ||
return; | ||
} | ||
|
||
echo 'Proceeding to process data'; | ||
} | ||
|
||
/** | ||
* @return string[] | ||
*/ | ||
protected function getInitData(): array | ||
{ | ||
return []; | ||
} | ||
|
||
/** | ||
* @return string[] | ||
*/ | ||
protected function getExtra(): array | ||
{ | ||
return []; | ||
} | ||
} |