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; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/L7Bs3
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   DECLARE_CLASS                                            'ff_feedmanager%5Cfeedmanager'
   44     1        DECLARE_CLASS                                            'ff_feedmanager%5Cdrupalfeedmanager'
   75     2        ECHO                                                     'HD'
   76     3        ECHO                                                     '50512'
   77     4      > RETURN                                                   1

Class FF_FeedManager\DisplayTypes: [no user functions]
Class FF_FeedManager\DeliveryTypes: [no user functions]
Class FF_FeedManager\FeedManager:
Function getfeed:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/L7Bs3
function name:  GetFeed
number of ops:  4
compiled vars:  !0 = $id, !1 = $displayType, !2 = $deliveryType
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3      > RETURN                                                   null

End of function getfeed

Function getallfeeds:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/L7Bs3
function name:  GetAllFeeds
number of ops:  2
compiled vars:  !0 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   40     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function getallfeeds

End of class FF_FeedManager\FeedManager.

Class FF_FeedManager\DrupalFeedManager:
Function getfeed:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/L7Bs3
function name:  GetFeed
number of ops:  20
compiled vars:  !0 = $id, !1 = $displayType, !2 = $deliveryType, !3 = $url, !4 = $deliverType
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   47     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   48     3        INIT_NS_FCALL_BY_NAME                                    'FF_FeedManager%5Cdb_result'
   49     4        INIT_NS_FCALL_BY_NAME                                    'FF_FeedManager%5Cdb_query'
   50     5        SEND_VAL_EX                                              'SELECT+url+FROM+azure_endpoints+WHERE+kid+LIKE+%27%25s%27+AND+display_type+LIKE+%27%25s%27+AND+delivery_type+LIKE+%27%25s%27'
          6        SEND_VAR_EX                                              !0
          7        SEND_VAR_EX                                              !1
          8        SEND_VAR_EX                                              !4
          9        DO_FCALL                                      0  $5      
         10        SEND_VAR_NO_REF_EX                                       $5
         11        DO_FCALL                                      0  $6      
   48    12        ASSIGN                                                   !3, $6
   56    13        ISSET_ISEMPTY_CV                                         !3
         14      > JMPZ                                                     ~8, ->17
         15    >   QM_ASSIGN                                        ~9      !3
         16      > JMP                                                      ->18
         17    >   QM_ASSIGN                                        ~9      <false>
         18    > > RETURN                                                   ~9
   58    19*     > RETURN                                                   null

End of function getfeed

Function getallfeeds:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 8
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 8
Branch analysis from position: 19
Branch analysis from position: 8
filename:       /in/L7Bs3
function name:  GetAllFeeds
number of ops:  21
compiled vars:  !0 = $id, !1 = $feeds_result, !2 = $feeds_array, !3 = $feed
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   60     0  E >   RECV                                             !0      
   61     1        INIT_NS_FCALL_BY_NAME                                    'FF_FeedManager%5Cdb_query'
   62     2        SEND_VAL_EX                                              'SELECT+display_type%2C+delivery_type%2C+url+FROM+azure_endpoints+WHERE+kid+LIKE+%27%25s%27'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0  $4      
   61     5        ASSIGN                                                   !1, $4
   65     6        ASSIGN                                                   !2, <array>
   67     7      > JMP                                                      ->14
   68     8    >   FETCH_DIM_R                                      ~7      !3, 'display_type'
          9        FETCH_DIM_R                                      ~9      !3, 'delivery_type'
         10        FETCH_DIM_R                                      ~11     !3, 'url'
         11        FETCH_DIM_W                                      $8      !2, ~7
         12        ASSIGN_DIM                                               $8, ~9
         13        OP_DATA                                                  ~11
   67    14    >   INIT_NS_FCALL_BY_NAME                                    'FF_FeedManager%5Cdb_fetch_array'
         15        SEND_VAR_EX                                              !1
         16        DO_FCALL                                      0  $12     
         17        ASSIGN                                           ~13     !3, $12
         18      > JMPNZ                                                    ~13, ->8
   71    19    > > RETURN                                                   !2
   72    20*     > RETURN                                                   null

End of function getallfeeds

End of class FF_FeedManager\DrupalFeedManager.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.86 ms | 1403 KiB | 17 Q