I've stuck on a seems-to-be simple command join, but can't work it out.
I have a between()
function which does the following:
/**
* Checks if passed int is between $left and $right
* @param int $left lowest value
* @param int $right highest value
* @param int $value actual value
* @return bool is $value between $left and $right
*/
function between($left, $right, $value)
{
$value = intval($value);
return ( $value >= $left && $value <= $right );
}
and the usage is pretty simple:
$int = 9;
var_dump( between( 6, 14, $int ) );//bool(true)
Now what I want to achieve is:
$int = 9;
var_dump( $int.between( 6, 14 ) );//bool(true)
it would make more sense and would be easier to understand.
Any ideas how do I achieve this?
If $int
would be an object which extends comparisonFunctions I could do $int->between();
but maybe there is a way to catch what does . join?
Thanks in advance