3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Test{ var $publicval; var $privateval; function __construct() { $this->publicval = 'Public'; $this->privateval = 'Private'; } function getPrivate() { return $this->privateval; } } $test = new Test(); echo($test->publicval); echo($test->getPrivate());
Output for 5.1.3 - 7.2.6
PublicPrivate
Output for 5.0.0 - 5.1.2
Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/ROnD1 on line 4 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/ROnD1 on line 5 PublicPrivate
Output for 4.3.0 - 4.4.9