<?php
namespace AcmeSomething;
class SomeException extends \Exception {
}
function getDomain() {
return 'example.com';
}
function getSubDomains() {
return array('www.example.com');
}
function register($domainKeys, $subdomains) {
$domains = (array) getDomain();
if ($subdomains == null) {
$domains = array_merge($domains, getSubdomains());
} else {
$domains = array_merge($domains, $subdomains);
}
$san = implode(",", array_map(function ($dns) {
return "DNS:" . $dns;
}, $domains));
throw new SomeException("yo");
return $domains;
}
function register2($domainKeys, $subdomains) {
try {
register($domainKeys, $subdomains);
}
catch(Exception $e) {
throw new \Exception("exception gevangen: " . $e->getMessage(), $e->getCode(), $e);
}
}
var_dump(register2(null, (array)$nonset));
preferences:
56.07 ms | 402 KiB | 5 Q