Exclude Subnet from Network:
$excluded = Network::parse('192.0.0.0/8')->exclude(new Network('192.168.1.0/24'));
foreach($excluded as $network) {
echo (string)$network . '<br>';
}
PHP Fatal error: Uncaught TypeError: IPTools\Network::__construct(): Argument #1 ($ip) must be of type IPTools\IP, string given, called in /home/www/test/1.php on line 37 and defined in /home/www/test/vendor/s1lentium/iptools/src/Network.php:32
Stack trace:
#0 /home/www/test/1.php(37): IPTools\Network->__construct()
#1 {main}
thrown in /home/www/test/vendor/s1lentium/iptools/src/Network.php on line 32
Upd.
Error in example:
$excluded = Network::parse('192.0.0.0/8')->exclude(new Network('192.168.1.0/24'));
to
$excluded = Network::parse('192.0.0.0/8')->exclude('192.168.1.0/24');
Exclude Subnet from Network:
Upd.
Error in example:
$excluded = Network::parse('192.0.0.0/8')->exclude(new Network('192.168.1.0/24'));to
$excluded = Network::parse('192.0.0.0/8')->exclude('192.168.1.0/24');