3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); class X { protected $hi = 'protected'; private $test = 'private'; public $public = 'public'; public function test(int $test) { return $test; } } $y = '14'; $x = new X(); var_dump($x->test($y));

preferences:
27 ms | 402 KiB | 5 Q