3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php //require_once("human.php"); //require("skills.php"); class You { public $role = "Developer"; public $skills = array("Web Development", "php", "MySQL", "HTML", "CSS"); public $person = array("Talent", "Humour", "Experience"); public function find() { $c = 0; if(in_array("Web Development", $this->skills)) { foreach ($this->skills as &$skill) { if (strpos($skill, "Web")) $c .= +2; else $c++; } } return $c; } } $Developer = new You(); $requiredLevel = 6; if($Developer->find() >= $requiredLevel) echo "yep"; else echo "nop"; ?>
Output for 5.0.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
nop
Output for 4.4.2 - 4.4.9
<br /> <b>Parse error</b>: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in <b>/in/oEAUh</b> on line <b>7</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
<br /> <b>Parse error</b>: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in <b>/in/oEAUh</b> on line <b>7</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.3.4
<br /> <b>Parse error</b>: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in <b>/in/oEAUh</b> on line <b>7</b><br />
Process exited with code 255.