3v4l.org

run code in 300+ PHP versions simultaneously
<?php function makeClass($someData) { $c = new class { public static $d; public static function getData() { return self::$d; } }; $c::$d = $someData; return $c; }; $c1 = makeClass('a'); $c2 = makeClass('b'); assert($c1 !== $c2); assert($c2::getData() === 'b'); assert($c1::getData() === 'a'); assert(get_class($c1) !== get_class($c2)); echo "Ok";
Output for git.master_jit, git.master, rfc.property-hooks
Fatal error: Uncaught AssertionError: assert($c1::getData() === 'a') in /in/ZSoeI:19 Stack trace: #0 /in/ZSoeI(19): assert(false, 'assert($c1::get...') #1 {main} thrown in /in/ZSoeI on line 19
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:
79.63 ms | 401 KiB | 8 Q