3v4l.org

run code in 500+ PHP versions simultaneously
<?php class X { const A = null; } // ?? works with class constants echo X::A ?? 3; // parse error, invalid syntax //echo X::{A} ?? 3; // quotes are needed, or a global constant const A = 'A'; echo X::{A}; // @ does not hide undefined constants echo @X::{'B'};
Output for git.master_jit, git.master
3 Fatal error: Uncaught Error: Undefined constant X::B in /in/QKvnA:18 Stack trace: #0 {main} thrown in /in/QKvnA on line 18
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:
52.74 ms | 870 KiB | 4 Q