3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Products{ // Properties protected $_title; protected $_category; public static $error = "Fout opgetreden"; protected static $_changes_saved = "Wijzigingen opgeslagen"; // Methods public function __construct($title, $category){ $this->_title = $title; $this->_category = $category; } public function someFunction(){ self::$_changes_saved; } public static function convertMeterToCentimeter($meter){ return $meter * 100; } public function Length(){ $length = self::convertMeterToCentimeter(3); } public function getCategory(){ return $this->_category; } public function getTitle(){ return $this->_title; } } echo Products::$error; // displays Fout opgetreden echo Products::convertMeterToCentimeter(2); displays 200
Output for 5.4.0 - 5.4.29
Parse error: syntax error, unexpected '200' (T_LNUMBER) in /in/2kCqd on line 32
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_LNUMBER in /in/2kCqd on line 32
Process exited with code 255.