3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace FF_FeedManager; interface DisplayTypes { // Display Types const SD = 'SD'; const HD = 'HD'; const FID = 'FID'; const UHD = 'UHD'; // 4x or Ultra HD } interface DeliveryTypes { // Delivery Types const HLS = 'HLS'; const SS = 'SS'; const DASH = 'DASH'; const F50512 = '50512'; const F50522 = '50522'; const F60181 = '60181'; const F60171 = '60171'; } interface FeedManager extends DisplayTypes,DeliveryTypes { /** * Get the URL for the given FeedType * @param $id Kaltura ID * @param $display_type HD,SD,etc * @param $delivery_type HLS,SS,etc *. * @return string */ public function GetFeed($id, DisplayTypes $displayType, DeliveryTypes $deliveryType); /** * Get all of the feeds * @param $id Kaltura ID * * @return array */ public function GetAllFeeds($id); } class DrupalFeedManager implements FeedManager { // No need for a constructor for the DB connector public function GetFeed($id, DisplayTypes $displayType, DeliveryTypes $deliveryType) { $url = db_result( db_query( "SELECT url FROM azure_endpoints WHERE kid LIKE '%s' AND display_type LIKE '%s' AND delivery_type LIKE '%s'", $id, $displayType, $deliverType ) ); return isset($url) ? $url : FALSE; } public function GetAllFeeds($id) { $feeds_result = db_query( "SELECT display_type, delivery_type, url FROM azure_endpoints WHERE kid LIKE '%s'", $id ); $feeds_array = array(); while ($feed = db_fetch_array($feeds_result)) { $feeds_array[$feed['display_type']][$feed['delivery_type']] = $feed['url']; } return $feeds_array; } } print DisplayTypes::HD; print DeliveryTypes::F50512; ?>
Output for 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.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
HD50512
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
Parse error: syntax error, unexpected T_STRING in /in/L7Bs3 on line 2
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, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_STRING in /in/L7Bs3 on line 2
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/L7Bs3 on line 2
Process exited with code 255.

preferences:
274.47 ms | 401 KiB | 371 Q