3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Module { protected $_name; protected $_version; public function __construct(string $name, string $version) { $this->_name = $name; $this->_version = $version; } } $s = microtime(true); for ($i = 0; $i < 1000; $i++) { new Module('Framework', '1.10'); } var_dump(microtime(true) - $s); $s = microtime(true); for ($i = 0; $i < 1000; $i++) { new class extends Module { public function __construct() { } protected $_name = 'Framework'; protected $_version = '1.10'; }; } var_dump(microtime(true) - $s);

preferences:
31.69 ms | 402 KiB | 5 Q