PHP Exception Handling

Exception handling is an effective way to handle errors, modern Object oriented extensions use exceptions. Throw an Exception: We have to use PHP built-in class "Exception". To throw an exception with command "throw new Exception()". Write custom error message between brackets(). throw new Exception('Promo value cannot be less than or equal to zero.'); Try/Catch Block:... Continue Reading →

PHP Namespaces

Namespace benefits, avoiding name collision when we integrate from different resources like third party libraries & packages. Define a namespace: We define namespaces at the top of page with "namespace" keyword. No other codes allowed to place before "namespace" keyword - with one exception, "declare" keyword. namespace Le\Product\Age; How to use a namespace class: Example... Continue Reading →

2018 7Design.Studio | Web Design, Web Application Development & UX Design | Chennai | India

Up ↑