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"); 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(); ?>
Output for git.master, git.master_jit, rfc.property-hooks
Hello! My name is Nabir, I am 19 years old and it is true that I am a male.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
45.89 ms | 401 KiB | 8 Q