Question from the PHP8 test

Which function signature is valid?

Easy

Which function signature is valid?

function bar1(Foo|null $param): void {

    } 
function bar2(?Foo $param): void {  

    } 
Author: Clément DevosStatus: PublishedQuestion passed 952 times
Edit
3
Community EvaluationsNo one has reviewed this question yet, be the first!