3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Car { function Car() { $this->model=”VW”; } } //create an object $herbie= new Car(); //show object properties echo $herbie->model; ?>
based on menPR
Output for 7.2.0
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Car has a deprecated constructor in /in/bvZWq on line 3 Warning: Use of undefined constant ”VW” - assumed '”VW”' (this will throw an Error in a future version of PHP) in /in/bvZWq on line 5 ”VW”
Output for 7.0.0 - 7.1.10
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Car has a deprecated constructor in /in/bvZWq on line 3 Notice: Use of undefined constant ”VW” - assumed '”VW”' in /in/bvZWq on line 5 ”VW”
Output for 5.3.20 - 5.6.28
Notice: Use of undefined constant ”VW” - assumed '”VW”' in /in/bvZWq on line 5 ”VW”