1--TEST-- 2getmxrr() test 3--SKIPIF-- 4<?php 5if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); 6if (getenv("SKIP_ONLINE_TESTS")) die("skip test requiring internet connection"); 7if (substr(PHP_OS, 0, 3) == 'WIN') { 8 die('skip: no Windows support'); 9} 10if (getenv('SKIP_MSAN')) die('skip msan missing interceptor for dn_expand()'); 11?> 12--FILE-- 13<?php 14$domains = array( 15 'mx1.tests.php.net.', 16 'mx2.tests.php.net.', 17 'qa.php.net.', 18); 19foreach ($domains as $domain) { 20 $result = getmxrr($domain, $hosts, $weights); 21 echo "Result: " . ($result ? "true" : "false") 22 . ", hosts: " . count( $hosts ) 23 . ", weights: " . count( $weights ) . "\n"; 24} 25?> 26--EXPECT-- 27Result: true, hosts: 1, weights: 1 28Result: true, hosts: 2, weights: 2 29Result: false, hosts: 0, weights: 0 30