3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Example { private $string; private $int; private $bool; function __construct() { $this->string = "Nabir"; $this->int = 19; $this->bool = true; } function printDetails() { $genderCheck = ($this->bool == true ? "true" : "false"); return printf("Hello! My name is %s, I am %d years old and it is $genderCheck that I am a male.", $this->string, $this->int); } } $instance = new Example(); echo $instance->printDetails(); ?>

preferences:
39.18 ms | 402 KiB | 5 Q