3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function mask($ip, $cdir) { list ($net, $mask) = explode("/", $cdir); return ((ip2long($ip) & (~((1 << (32 - $mask)) - 1))) == ip2long($net)); } $ip = '104.192.143.208'; if (!mask($ip, '104.192.143.192/28') && !mask($ip, '104.192.143.208/28')) { echo "not allowed"; } else { echo "allowed"; }
based on FnLvt
Output for 5.6.0 - 7.3.0beta1
allowed