Skip to content

Instantly share code, notes, and snippets.

View Intrepidity's full-sized avatar

Bart Intrepidity

  • Digitec Galaxus
  • Geneva, Switzerland
View GitHub Profile
<?php
function random_exception()
{
foreach(get_declared_classes() as $class) {
$exceptions = [];
if (substr($class, -9) === 'Exception') {
$exceptions[] = $class;
}
$exception = $exceptions[array_rand($exceptions)];