-1
메서드에서 throw 된 예외를 처리하는 방법은 무엇입니까? 이 방법은PHP 5.4의 메소드에 의해 던진 예외를 처리하는 방법은 무엇입니까?
<?php
class AllAccidents
{
public static function check() {
try {
$x = 1;
if($x)
throw new Exception("Value must be more than 1");
}catch (Exception $e){
echo "hello>>".$e->getMessage();
}
}
}
class Test
{
public function go(){
try{
AllAccidents::check();
} catch (Exception $e){
}
}
}
$obj = new Test();
$obj->go();
?>