3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class C { public string $a; public string $b; public function __construct($a, $b) { $this->a = $a; $this->b = $b; } } // test only a $c = new C("foo", null); var_dump($c->a === "foo"); // test only b $c = new C(null, "foo"); var_dump($c->b === "foo"); ?>
Output for 5.4.0 - 5.4.11
Parse error: syntax error, unexpected 'string' (T_STRING), expecting variable (T_VARIABLE) in /in/EKk50 on line 3
Process exited with code 255.
Output for 5.3.0 - 5.3.21
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE in /in/EKk50 on line 3
Process exited with code 255.