PHP 7 ������

PHP 7 �ı��˴��������ı��淽ʽ����ͬ�ڴ�ͳ��PHP 5���Ĵ��󱨸���ƣ����ڴ����������Ϊ Error �쳣�׳���

���� Error �쳣������ Exception �쳣һ������һ��ƥ��� try / catch �����������û��ƥ��� catch �飬������쳣������������ͨ�� set_exception_handler() ע�ᣩ���д��� �����δע���쳣�����������մ�ͳ��ʽ����������Ϊһ����������Fatal Error����

Error �ಢ�Ǽ̳��� Exception �࣬���Բ����� catch (Exception $e) { ... } ������ Error��������� catch (Error $e) { ... }������ͨ��ע���쳣�������� set_exception_handler()�������� Error��

Error ��νṹ

  • Throwable
    • Error
      • ArithmeticError
        • DivisionByZeroError
      • AssertionError
      • ParseError
      • TypeError
    • Exception
      • ...