3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class test { private $data = array(); public function __get($key) { echo "get $key\n"; return $this->data[$key]; } public function __set($key, $value) { echo "set $key = $value\n"; $this->data[$key] = $value; } public function __isset($key) { return isset($this->data[$key]); } } $test = new test(); var_dump(property_exists($test, 'x')); var_dump(isset($test->x)); $test->x = 42; var_dump(property_exists($test, 'x')); var_dump(isset($test->x));
Output for 5.1.0 - 7.1.0
bool(false) bool(false) set x = 42 bool(false) bool(true)
Output for 5.0.0 - 5.0.5
Fatal error: Call to undefined function property_exists() in /in/7E04f on line 24
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/7E04f on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/7E04f on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/7E04f on line 5
Process exited with code 255.