3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php /** * @author Brian Sandes * brian.sandes@gmail.com * Post class * Servus! Open-Source Development Framework */ class Product extends AppModel { public $Table = "{__PREF__}products"; public $Fields = Array( "id" => Array("extra" => "auto_increment"), "product_category_id" => Array("required" => true), "product_subcategory_id" => Array("required" => true), "line_id" => Array("required" => true), "name" => Array("type" => "text", "required" => true), "description" => Array("type" => "text"), "code" => Array("type" => "text"), "model" => Array("type" => "text"), "details" => Array("type" => "text", "class" => "simple-tinymce"), "blueprint" => Array("type" => "file"), "guide" => Array("type" => "file"), "dwg" => Array("type" => "file"), "video" => Array("type" => "text"), "bndes" => Array("type" => "checkbox"), "ambient" => Array(), "display_order" => Array("type" => "text"), "date" => Array("function" => "return date('Y-m-d H:i:s');", "display" => "return toDate('\$1', 'd/m/Y H:i:s');"), "last_update" => Array("display" => "return toDate('\$1', 'd/m/Y H:i:s');"), "status" => Array("type" => "radio") ); public static $Conf = Array( "mode" => "LAED", "grid" => Array("id", "name", "code", "category", "subcategory", "product_line", "last_update"), "icon" => "icon-shopping-cart" ); public function AltQuery($where = null, $plus = null) { $ProductCategory = new ProductCategory(); $ProductLine = new ProductLine(); $ProductImage = new ProductImage(); $Href = new Href(); return "SELECT {$this->Table}.*, c1.name as category, c2.name as subcategory, {$ProductLine->Table}.name as product_line, {$ProductImage->Table}.name as listing_image, {$Href->Table}.ref as ref FROM {$this->Table} LEFT OUTER JOIN {$ProductCategory->Table} c1 ON {$this->Table}.product_category_id = c1.id LEFT OUTER JOIN {$ProductCategory->Table} c2 ON {$this->Table}.product_subcategory_id = c2.id LEFT OUTER JOIN {$ProductLine->Table} ON {$this->Table}.line_id = {$ProductLine->Table}.id LEFT OUTER JOIN {$ProductImage->Table} ON {$ProductImage->Table}.product_id = {$this->Table}.id AND {$ProductImage->Table}.type = 'listing' LEFT OUTER JOIN {$Href->Table} ON {$Href->Table}.content_id = {$this->Table}.id and {$Href->Table}.type = 'product' $where GROUP BY {$this->Table}.id $plus"; } } ?>
Output for 5.0.0 - 5.6.28, 7.0.0 - 7.1.0
Fatal error: Class 'AppModel' not found in /in/WQeWn on line 9
Process exited with code 255.
Output for hhvm-3.12.0
Fatal error: Uncaught Error: unknown class AppModel in /in/WQeWn:9 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.10.0
Fatal error: unknown class AppModel in /in/WQeWn on line 9
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/WQeWn on line 10
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/WQeWn on line 10
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/WQeWn on line 10
Process exited with code 255.