3v4l.org

run code in 300+ PHP versions simultaneously
<?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 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Uncaught Error: Class "AppModel" not found in /in/WQeWn:9 Stack trace: #0 {main} thrown in /in/WQeWn on line 9
Process exited with code 255.
Output for 7.3.12 - 7.3.33, 7.4.0 - 7.4.33
Fatal error: Uncaught Error: Class 'AppModel' not found in /in/WQeWn:9 Stack trace: #0 {main} thrown in /in/WQeWn on line 9
Process exited with code 255.
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.10, 7.2.0 - 7.2.33
Fatal error: Class 'AppModel' not found 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.3.11, 4.4.0 - 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.

preferences:
205.15 ms | 401 KiB | 354 Q