3v4l.org

run code in 300+ PHP versions simultaneously
<?php const A = 1; const B = A * 2; class C { const C = B + 1; const ONE_THIRD = A / self::C; const SENTENCE = 'The value of THREE is '.self::C; public function f($a = A + self::C) { return $a; } } echo (new C)->f()."\n"; echo C::SENTENCE; ?>
Output for git.master, git.master_jit, rfc.property-hooks
4 The value of THREE is 3

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