Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude Subnet from Network not work #45

Open
4khobta opened this issue Apr 9, 2024 · 0 comments
Open

Exclude Subnet from Network not work #45

4khobta opened this issue Apr 9, 2024 · 0 comments

Comments

@4khobta
Copy link

4khobta commented Apr 9, 2024

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');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant