logo logo
  • Articles
  • Snippets
  • Topics
    • Login
    • Register

    • Mode:

How to go to catch instead of try in PHP try catch

  • Feb 01, 2023
  • Snippet ยท 1 min
  • 47 words
  • Share profile in a message
  • Save your profile to PDF
  • Lock profile

  • Profile settings
  • Like (0)
  • Favorite (0)

You quickly give an exception and throw in a try-catch. So they try not to execute.

try {
    print "enter to try";
    throw new Exception();
} catch (Exception $e) {
    print "something went wrong, enter in catch";
} finally {
    print "oh! in final";
}

PHP
avatar
Md Najmul Hasan

Similar Stories

2 dimensional array sum the value

snippet

Make array as an object in PHP

snippet

Difference between number_format vs round in php

snippet

Carbon this month all days in an array in PHP

snippet
Random Stories

Flat an Multi Dimensional Array in Javascript

snippet

Upload an image and instant show or preview that image in html form

snippet

Getting error to install php artisan ui react --auth for Laravel react ui the error is Could not resolve dependency: peer vite@"^3.0.0" from @vitejs/[email protected]

snippet

Turn on multiple window in a single click in JavaScript

snippet

Install SSH Into a VirtualBox Ubuntu Server

snippet