3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Gender extends SplEnum { const MALE = 1 , FEMALE = 2 ; } // define a Person object with name, age and gender properties class Person { private $name , $age , $gender ; public function __construct($name, $age, Gender $gender) { $this->name = $name; $this->age = (int) $age; $this->gender = $gender; } public function isMale() { return ($this->gender == Gender::MALE); } public function isFemale() { return ($this->gender == Gender::FEMALE); } }
based on VPCe7
Output for 7.0.0 - 7.2.0
Fatal error: Class 'SplEnum' not found in /in/98BFf on line 3
Process exited with code 255.
Output for 5.3.22 - 5.6.28
Fatal error: Class 'SplEnum' not found in /in/98BFf on line 4
Process exited with code 255.