3v4l.org

run code in 300+ PHP versions simultaneously
<?php header("Cache-Control: max-age=301, must-revalidate, stale-while-revalidate=150, stale-if-error=60"); $env = getenv("SERVER_ENV"); $INSTRUCTOR_LOCATIONS = array( 'sandbox' => 'http://sandbox.bbc.co.uk:9000/', 'int' => 'http://crb-brb-instructor.int.api.bbci.co.uk/', 'test' => 'http://crb-brb-instructor.test.api.bbci.co.uk/', 'stage' => 'http://crb-brb-instructor.api.bbci.co.uk/', 'live' => 'http://crb-brb-instructor.api.bbci.co.uk/' ); $PLATFORMS = array('freeview', 'freesat'); $REGISTRATION_ENABLED_ON = array('sandbox', 'int', 'test', 'stage', 'live'); $instructorLocation = (isset($INSTRUCTOR_LOCATIONS[$env])) ? $INSTRUCTOR_LOCATIONS[$env] : 'http://config-error/'; $registrationEnabled = (in_array($env, $REGISTRATION_ENABLED_ON)) ? 'true' : 'false'; //$platformName = isset($_GET['platformName']) ? $_GET['platformName'] : ''; //$platform = in_array($platformName, $PLATFORMS) ? $platformName : 'freesat'; // Helper methods function printRCValue($tagName, $value) { print sprintf("@%s|%s|\n", $tagName, $value); } // Generate RC file response printRCValue('ServerEnvironment', $env); printRCValue('ServerLocation', "http://open.$env.bbc.co.uk/smartbridge/"); printRCValue('InstructorLocation', $instructorLocation); printRCValue('RegistrationEnabled', $registrationEnabled); //printRCValue('MakeAndModelServiceLocation', "http://open.int.bbc.co.uk/smartbridge/content-provider/platform/$platform/makeAndModel.rc?whoami=PANT14A01");
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 24
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 24
Branch analysis from position: 22
Branch analysis from position: 24
filename:       /in/OX1BW
function name:  (null)
number of ops:  46
compiled vars:  !0 = $env, !1 = $INSTRUCTOR_LOCATIONS, !2 = $PLATFORMS, !3 = $REGISTRATION_ENABLED_ON, !4 = $instructorLocation, !5 = $registrationEnabled
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'header'
          1        SEND_VAL                                                 'Cache-Control%3A+max-age%3D301%2C+must-revalidate%2C+stale-while-revalidate%3D150%2C+stale-if-error%3D60'
          2        DO_ICALL                                                 
    3     3        INIT_FCALL                                               'getenv'
          4        SEND_VAL                                                 'SERVER_ENV'
          5        DO_ICALL                                         $7      
          6        ASSIGN                                                   !0, $7
    5     7        ASSIGN                                                   !1, <array>
   13     8        ASSIGN                                                   !2, <array>
   15     9        ASSIGN                                                   !3, <array>
   17    10        ISSET_ISEMPTY_DIM_OBJ                         0          !1, !0
         11      > JMPZ                                                     ~12, ->15
         12    >   FETCH_DIM_R                                      ~13     !1, !0
         13        QM_ASSIGN                                        ~14     ~13
         14      > JMP                                                      ->16
         15    >   QM_ASSIGN                                        ~14     'http%3A%2F%2Fconfig-error%2F'
         16    >   ASSIGN                                                   !4, ~14
   18    17        INIT_FCALL                                               'in_array'
         18        SEND_VAR                                                 !0
         19        SEND_VAR                                                 !3
         20        DO_ICALL                                         $16     
         21      > JMPZ                                                     $16, ->24
         22    >   QM_ASSIGN                                        ~17     'true'
         23      > JMP                                                      ->25
         24    >   QM_ASSIGN                                        ~17     'false'
         25    >   ASSIGN                                                   !5, ~17
   29    26        INIT_FCALL                                               'printrcvalue'
         27        SEND_VAL                                                 'ServerEnvironment'
         28        SEND_VAR                                                 !0
         29        DO_FCALL                                      0          
   30    30        INIT_FCALL                                               'printrcvalue'
         31        SEND_VAL                                                 'ServerLocation'
         32        ROPE_INIT                                     3  ~21     'http%3A%2F%2Fopen.'
         33        ROPE_ADD                                      1  ~21     ~21, !0
         34        ROPE_END                                      2  ~20     ~21, '.bbc.co.uk%2Fsmartbridge%2F'
         35        SEND_VAL                                                 ~20
         36        DO_FCALL                                      0          
   31    37        INIT_FCALL                                               'printrcvalue'
         38        SEND_VAL                                                 'InstructorLocation'
         39        SEND_VAR                                                 !4
         40        DO_FCALL                                      0          
   32    41        INIT_FCALL                                               'printrcvalue'
         42        SEND_VAL                                                 'RegistrationEnabled'
         43        SEND_VAR                                                 !5
         44        DO_FCALL                                      0          
   33    45      > RETURN                                                   1

Function printrcvalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OX1BW
function name:  printRCValue
number of ops:  9
compiled vars:  !0 = $tagName, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   25     2        INIT_FCALL                                               'sprintf'
          3        SEND_VAL                                                 '%40%25s%7C%25s%7C%0A'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $2      
          7        ECHO                                                     $2
   26     8      > RETURN                                                   null

End of function printrcvalue

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.86 ms | 1407 KiB | 25 Q