- class_exists: documentation ( source)
- interface_exists: documentation ( source)
<?php
if (!interface_exists('Throwable', false)) {
interface Throwable
{
}
}
if (!class_exists('Error', false)) {
// We can't really avoid making this extend Exception in PHP 5.
class Error extends Exception implements Throwable
{
}
}
if (!class_exists('TypeError', false)) {
class TypeError extends Error
{
}
}