I was wondering if there's a one liner for PHP
that would allow me test multiple values against a function call. As example, say I want to test if foo()
returns either 1 or 2, (in pseudo code)
if( [1||2]==foo() );
Maybe above is a bad example of what I mean. Currently if I want to test two values against a function call I would use:
$test = foo();
if( 1==$test || 2==$test );
Its these two lines that I would like to simplify into one