@ 2018-06-30T03:58:57Z <?php
$adjectives = [
"Abaft",
"Abandoned",
"Abased",
"Abashed",
"Abasic",
"Abbatial",
"Abdicable",
"Abdicant",
"Abdicative",
"Abdominal",
"Abdominous",
"Abducent",
"Aberrant",
"Aberrational",
];
$animals = [
"aardvark",
"aardwolf",
"abalone",
"abyssiniancat",
"abyssiniangroundhornbill",
"acaciarat",
"achillestang",
"acornbarnacle",
"acornweevil",
"acornwoodpecker",
"acouchi",
"adamsstaghornedbeetle",
"addax",
"adder",
];
class AnimalIDs{
protected $adjectives = null;
protected $animals = null;
public function __construct($adjectives, $animals){
$this->adjectives = $adjectives;
$this->animals = $animals;
}
public function get($adjectivesNum = 1,$format = 'dash'){
$result = '';
$delim = '';
for($n = 0; $n < $adjectivesNum; $n++){
if($format === 'dash'){
$result .= $delim . $this->adjectives[rand(0,count($this->adjectives) - 1)];
$delim = '-';
}
}
$result .= $delim . $this->animals[rand(0,count($this->animals) - 1)];
return $result;
}
}
$a = new AnimalIDs($adjectives, $animals);
echo $a->get()."\n";
echo $a->get(2)."\n";
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).
Version System time (s) User time (s) Memory (MiB) 7.3.1 0.006 0.010 16.42 7.3.0 0.008 0.004 16.41 7.2.13 0.004 0.011 16.67 7.2.12 0.009 0.009 16.70 7.2.11 0.010 0.001 16.70 7.2.10 0.008 0.011 16.91 7.2.9 0.006 0.009 16.77 7.2.8 0.011 0.004 16.88 7.2.7 0.036 0.007 16.09 7.2.6 0.039 0.009 15.90 7.2.5 0.033 0.009 15.94 7.2.4 0.031 0.009 15.99 7.2.3 0.029 0.013 16.05 7.2.2 0.042 0.007 16.02 7.2.1 0.035 0.006 16.00 7.2.0 0.035 0.003 15.98 7.1.25 0.006 0.009 15.63 7.1.17 0.068 0.005 13.55 7.1.16 0.067 0.010 14.00 7.1.15 0.061 0.011 14.04 7.1.14 0.076 0.005 13.93 7.1.13 0.063 0.006 13.86 7.1.12 0.067 0.005 13.92 7.1.11 0.068 0.008 14.05 7.1.10 0.086 0.011 13.82 7.1.9 0.129 0.008 13.70 7.1.8 0.118 0.012 13.90 7.1.7 0.102 0.007 13.82 7.1.6 0.108 0.011 31.88 7.1.5 0.141 0.008 31.85 7.1.4 0.155 0.007 31.48 7.1.3 0.078 0.012 31.64 7.1.2 0.103 0.015 31.74 7.1.1 0.128 0.010 13.55 7.1.0 0.100 0.008 13.88
preferences:dark mode live preview
34.66 ms | 401 KiB | 5 Q