3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A {} class B {} class Overloaded { protected $value; function setValue(string $x) { print __METHOD__ . '(string)' . PHP_EOL; $this->value = $x; } function setVаlue(int $x) { print __METHOD__ . '(int)' . PHP_EOL; $this->value = $x; } } $something = new Overloaded(); $something->setValue('120'); var_dump($something); $something->setVаlue(99); var_dump($something);

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
155.7 ms | 2602 KiB | 11 Q