3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Test; class Test { private $s; private $i; public function __construct(string $s, int $i) { assert($i > 3000); $this->s = $s; $this->i = $i; } public function foo() { return 's: ' . $this->s . ', i: ' . $this->i; } } try { $a = new Test('Hello, world!', 2015); echo $a->foo(); } catch (\Throwable $e) { echo $e; }

preferences:
37.76 ms | 402 KiB | 5 Q