3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = <<<PHP const LOST_CONSTANT_BEFORE = 42; class Foo { public function foo() { // throw notice about deprecated constructor } } const LOST_CONSTANT_AFTER = 42; PHP; set_error_handler(function($errno, $errstr) { throw new Exception($errstr, $errno); // convert error to exception }); try { eval($foo); } catch (Exception $e) { printf("error %d with message: %s\n", $e->getCode(), $e->getMessage()); } var_dump( class_exists('foo'), // exists! defined('LOST_CONSTANT_BEFORE'), // where is my constant defined('LOST_CONSTANT_AFTER') // where is my constant );
Output for git.master, git.master_jit, rfc.property-hooks
bool(true) bool(true) bool(true)

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:
59.19 ms | 401 KiB | 8 Q