3v4l.org

run code in 500+ PHP versions simultaneously
<?php class z { public readonly int $p; public readonly int $q; public function __construct() { $this->p = 1; } } $x = new z; // foreach skips undefined properties, readonly or not foreach($x as $k => $v) { print $k . " " . $v . PHP_EOL; } echo $x->q; ?>
Output for git.master_jit, git.master
p 1 Fatal error: Uncaught Error: Typed property z::$q must not be accessed before initialization in /in/cAniT:20 Stack trace: #0 {main} thrown in /in/cAniT on line 20
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:
35.2 ms | 862 KiB | 4 Q