3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Doper { private $name; private $id; public function __construct($id, $name) { $this->name = $name; $this->id = $id; } public function getName() { return $this->name; } /** * Return id * @return int */ public function getId() { return $this->id; } } $doper = new Doper('zuzu', 1); echo '<pre>'; print_r($doper); exit;

preferences:
40.67 ms | 402 KiB | 5 Q