3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); class Pont { public float $longueur; public float $largeur; public function getSurface(): float { return $this->longueur * $this->largeur; } } $pont = new Pont; $pont->longueur = 286.0; $pont->largeur = 15.0; $surface = $pont->getSurface(); var_dump($surface);

preferences:
42.83 ms | 404 KiB | 5 Q