We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Can someone show me example how to do this without conditional statements in PHP/JS/CoffeeScript? And if this is impossible (as I think) why are these languages in the list of possible languages for solutions?
I'm sure this is not for novices, comparable to other languages solutions and clear (it still contains comparison) but it is how exception should be handled in PHP.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day 16: Exceptions - String to Integer
You are viewing a single comment's thread. Return to all comments →
Can someone show me example how to do this without conditional statements in PHP/JS/CoffeeScript? And if this is impossible (as I think) why are these languages in the list of possible languages for solutions?
--- UPDATE ---
Ok. PHP solution is next
Thanks to http://stackoverflow.com/questions/36483800/php-string-to-integer-exception/36488040#36488040
I'm sure this is not for novices, comparable to other languages solutions and clear (it still contains comparison) but it is how exception should be handled in PHP.