4 ms·
Ohhh is that so? Show me how you do the following in Javascript. try{ $exceptionType = rand(1,10) > 5? BadMethodCallException::class
by cfv 8y ago
Ohhh is that so?
Show me how you do the following in Javascript.
try{
$exceptionType = rand(1,10) > 5?
BadMethodCallException::class
: LogicException::class;
throw new $exceptionType("smartass");
}
catch(BadMethodCallException $typed_1){
file_put_contents('php://stderr', "Bad method, ".$typed_1->getMessage());
}
catch(LogicException $typed_2){
file_put_contents('php://stderr', "Bad logic, ".$typed_2->getMessage());
}
or this:
function lieToMe(PHPMailer\PHPMailer\PHPMailer $mailer){
}
or this:
$mailStrategy = new MailStrategy();
$mailStrategy("email@example.com","Subject","Body");
Or any of the other actually cool things you get with PHP if you can cope with the language.
It's sad to see people who probably can't program a microwave diss an entire language they haven't ever actually used.