3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyBool { const MY_TRUE = 1; const MY_FALSE = 0; private $_type; private function __construct($type) { $this->_type = $type; } function Type() { return $this->_type; } static function MyTrue() { return new self(self::MY_TRUE); } static function MyFalse() { return new self(self::MY_FALSE); } } var_dump(MyBool::MyTrue());

preferences:
36.01 ms | 402 KiB | 5 Q