if (!$table->load(25)) { // handle error } //do other stuff here becomes try { $table->load(25); // do other stuff here } catch (RuntimeException $e) { // handle error }