79272480

Date: 2024-12-11 16:34:07
Score: 3.5
Natty:
Report link

Why not do it with a function?

public function maybe_add_to_array( array &$arr, string $key, $value, $condition ) {
    if (!$condition){
        return;
    }
    $arr[ $key ] = $value;
}
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Starts with a question (0.5): Why not
  • Low reputation (1):
Posted by: Meyer Auslander - Tst