Skip to content

Latest commit

 

History

History
15 lines (11 loc) · 256 Bytes

NullableReturnStatement.md

File metadata and controls

15 lines (11 loc) · 256 Bytes

NullableReturnStatement

Emitted if a return statement contains a null value, but the function return type is not nullable

<?php

function foo() : string {
    if (rand(0, 1)) {
        return "foo";
    }

    return null; // emitted here
}