3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { protected $hi = 'protected'; private $test = 'private'; public $public = 'public'; public function toInt(string $test) :int { return $test; } } $t = new Test(); var_dump($t->toInt("123"));

preferences:
31.22 ms | 402 KiB | 5 Q