3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php if(isset($_GET['server']) && !empty($_GET['server'])) { $ip = $_GET['server']; } $keys = array( '63.43.45.34' => 'something', '216.144.248.194' => 'something', '216.144.249.2' => 'something', '216.144.248.130' => 'something', '216.144.249.66' => 'something', '216.144.248.66' => 'something', '63.143.39.130' => 'something', '74.63.230.2' => 'something', '216.144.249.130' => 'something', '63.143.39.194' => 'something', '69.162.107.66' => 'something', '63.143.38.66' => 'something', '216.144.244.210' => 'something', '216.144.253.194' => 'something', '208.115.193.130' => 'something' ); var_dump(array_key_exists('63.43.45.34', $keys)); $ip = "63.43.45.34"; if (array_key_exists($ip, $keys)) { echo $keys[$ip]; } else { echo "OH NOES"; }
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
bool(true) something