3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ContextException extends RuntimeException { protected $context = array(); public function __construct($message='', $context=array(), $code=0) { $this->context = $context; parent::__construct($message, $code); } /** * Returns an array of variables that existed when exception occured. * @return array Array of variable name=>value pairs. */ public function getContext(){ return $this->context; } } $cheese = true; throw new ContextException('Something went wrong.', get_defined_vars(), E_NOTICE);

preferences:
38.98 ms | 402 KiB | 5 Q