3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result2 = '{ "wg0": { "privateKey": "[hidden]", "publicKey": "XXXXXXXXXXXXXXXXXXX", "listenPort": 0, "peers": { "B3GtLuabWguXoG2Tz8KVukPXx3twn7A+X/SVT8=": { "endpoint": "0.0.0.0:5377", "latestHandshake": "Oct 28, 2020 1:58:32 UTC", "transferRx": "2.432 GB", "transferTx": "1.098 GB", "allowedIps": [ "10.85.85.2/32" ] }, "2Uqo3X2ubogU92LS4mWsZtF04ah3qJ4gt1g0=": { "endpoint": "0.0.0.0:5412", "latestHandshake": "Oct 28, 2020 1:58:52 UTC", "transferRx": "32.239 MB", "transferTx": "220.852 MB", "allowedIps": [ "10.85.85.3/32" ] } } } }'; $obj2 = json_decode($result2, true); $IPtoSearch = "10.85.85.2/32"; foreach ($obj2['wg0']['peers'] as $peer) { if (in_array($IPtoSearch, $peer['allowedIps'])) { $latestHandshake = $peer['latestHandshake']; break; } } echo "Last handshake for $IPtoSearch was at $latestHandshake\n";
Output for git.master, git.master_jit, rfc.property-hooks
Last handshake for 10.85.85.2/32 was at Oct 28, 2020 1:58:32 UTC

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
28.72 ms | 405 KiB | 5 Q