HomeDevCentral

Avoid to compare shell_exec() result as false or null

Description

Avoid to compare shell_exec() result as false or null

Summary:
When comparing the command output with a string,
shell_exec() can returns false or null.

If it returns null, trim will receives NULL value,
and that's behavior is deprecated under PHP 7.4+:

trim(null) would return:

Deprecated: trim(): Passing null to parameter #1 ($string)
of type string is deprecated

Reviewers: dereckson

Reviewed By: dereckson

Differential Revision: https://devcentral.nasqueron.org/D2486

Details

Provenance
derecksonAuthored on Jan 26 2022, 18:41
derecksonPushed on Jan 26 2022, 19:43
Reviewer
dereckson
Differential Revision
D2486: Avoid to compare shell_exec() result as false or null
Parents
rKOT693251166e54: Bump phpunit, phan and phpcs versions
Branches
Unknown
Tags
Unknown