3v4l.org

run code in 300+ PHP versions simultaneously
<?php class F { private float $f; public function setF($m) { $this->f = $m; var_dump($this->f); } } $f = new F(); $f->setF(true); $f->setF(false); $f->setF(1); $f->setF(1.11); $f->setF(null);
Output for git.master_jit, git.master
float(1) float(0) float(1) float(1.11) Fatal error: Uncaught TypeError: Cannot assign null to property F::$f of type float in /in/qnsMN:7 Stack trace: #0 /in/qnsMN(17): F->setF(NULL) #1 {main} thrown in /in/qnsMN on line 7
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:
47.98 ms | 405 KiB | 5 Q