3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $cidr = "192.168.2.1, 23.34.45.56"; $arr = explode(",", filter_var($cidr)); foreach ($arr as $item) { echo "$item <br>"; } echo $arr[0]; echo "\n"; echo $arr[1]; $a = "1.2.3.4/"; $parts = explode("/", $a); echo $parts[0]; echo $parts[1]; if ($parts[1] == "") { echo "True"; } ?>
based on W5In2
Output for 5.5.0 - 7.1.7, 7.1.20 - 7.3.0rc3
192.168.2.1 <br> 23.34.45.56 <br>192.168.2.1 23.34.45.561.2.3.4True
Output for 7.1.10

Process exited with code 137.