Skip to content

InvalidThrow

A value that does not implement Throwable is thrown.

<?php
throw 'error message'; // string does not implement Throwable

Throw an instance of Exception or another Throwable class.

<?php
throw new \RuntimeException('error message');