Skip to content

Commit ba60ee2

Browse files
authored
iputils anonymize do not use named params
1 parent 7f6e80b commit ba60ee2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

components/http_foundation.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -362,16 +362,18 @@ analysis purposes. Use the ``anonymize()`` method from the
362362
$anonymousIpv6 = IpUtils::anonymize($ipv6);
363363
// $anonymousIpv6 = '2a01:198:603:10::'
364364

365-
If you need even more anonymization, you can use the second and third parameters
366-
of the ``anonymize()`` method to specify the number of bytes that should be
365+
If you need even more anonymization, you can use a second and third parameters
366+
to the ``anonymize()`` method to specify the number of bytes that should be
367367
anonymized depending on the IP address format::
368368

369369
$ipv4 = '123.234.235.236';
370-
$anonymousIpv4 = IpUtils::anonymize($ipv4, v4Bytes: 3);
370+
$anonymousIpv4 = IpUtils::anonymize($ipv4, 3);
371371
// $anonymousIpv4 = '123.0.0.0'
372372

373373
$ipv6 = '2a01:198:603:10:396e:4789:8e99:890f';
374-
$anonymousIpv6 = IpUtils::anonymize($ipv6, v6Bytes: 10);
374+
// (you must define the second argument (bytes to anonymize in IPv4 addresses)
375+
// even when you are only anonymizing IPv6 addresses)
376+
$anonymousIpv6 = IpUtils::anonymize($ipv6, 3, 10);
375377
// $anonymousIpv6 = '2a01:198:603::'
376378

377379
.. versionadded:: 7.2

0 commit comments

Comments
 (0)