3v4l.org

run code in 300+ PHP versions simultaneously
<?php class customException extends Exception { public function errorMessage() { $errorMsg = 'error on line ' .$this->getLine(). ' in '.$this->getFile().': <b>' .$this->geMessage().'</b> is not a valid e-mail address'; return $errorMsg; } } $emial = "someone@example.com"; try { if(filter_var($email, FILTER_VALIDATE_EMAIL) === false) { throw new customException($emial); } if(strpos($email,"example") !== FALSE) { throw new Exception("emial is an example e-mail"); } } catch (customException $e) { echo $e->errorMessage(); } catch(Excception $e) { echo $e->getMessage(); } ?>
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $email in /in/Q4dRS on line 12 Fatal error: Uncaught Error: Call to undefined method customException::geMessage() in /in/Q4dRS:4 Stack trace: #0 /in/Q4dRS(21): customException->errorMessage() #1 {main} thrown in /in/Q4dRS on line 4
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
97.34 ms | 401 KiB | 8 Q