Skip to content

Support a little algebra #13

@muglug

Description

@muglug

Not currently supported by Psalm (or Hack, or Flow)

function do_algebra() : string {
    $a = rand(0, 10) > 5 ? "a" : null;
    $b = rand(0, 10) > 5 ? "b" : null;

    if ($a === null && $b === null) {
        return "all null";
    } elseif ($a === null) {
        return $b;
    } else {
        return $a;
    }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions