3v4l.org

run code in 500+ PHP versions simultaneously
<?php final class SkipVariadic { private $b = 1; public function set($a, $b = null) { if (func_num_args() > 1) { $this->b = $b; } } public function get() { $this->set(1); return $this->b; } } $x = new SkipVariadic(); var_dump($x->get());
Output for 8.2.31 - 8.2.32, 8.3.5 - 8.3.33, 8.4.9 - 8.4.24, 8.5.6 - 8.5.9
int(1)

preferences:
52.87 ms | 545 KiB | 4 Q