if ( $x in [$min, $max] ) { ... } #inclusive container, # $x==$min would be true # OR if ( $x in ($min, $max) ) { ... } #exclusive container, # $x==$min would be false # OR if ( $x in ($min, $max] ) { ... } #mixed ends