3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Test { public function __construct(private int|float $multiplierEffect) { } public function doCalculation(int|float $input): int|float { $n = new \BcMath\Number($input); return $n->mul($this->multiplierEffect)->value; } } $test = new Test(3.4); var_dump($test->doCalculation(1.6));
Output for git.master, git.master_jit
Deprecated: Implicit conversion from float 1.6 to int loses precision in /in/6goJU on line 8 Deprecated: Implicit conversion from float 3.4 to int loses precision in /in/6goJU on line 10 int(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:
43.96 ms | 798 KiB | 4 Q