3v4l.org

run code in 300+ PHP versions simultaneously
<?php $getBitstampPrice = getPrice('https://www.bitstamp.net/api/v2/ticker/btcusd/'); $btcValues[2] = $getBitstampPrice['last']; //get from blockchain $getBlockchainPrice = getPrice('https://blockchain.info/ticker'); $btcValues[3] = $getBlockchainPrice['USD']['last']; //get from cytptonator $getCtyptonatorPrice = getPrice('https://api.cryptonator.com/api/ticker/btc-usd'); $btcValues[4] = $getCtyptonatorPrice['ticker']['price']; $total=0; for ($i=0; $i < count($btcValues[$i]); $i++) { $total +=$btcValues[$i]; } $average = $total/count($btcValues[$i]); return $average;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 26
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 26
Branch analysis from position: 33
Branch analysis from position: 26
filename:       /in/3ps0t
function name:  (null)
number of ops:  39
compiled vars:  !0 = $getBitstampPrice, !1 = $btcValues, !2 = $getBlockchainPrice, !3 = $getCtyptonatorPrice, !4 = $total, !5 = $i, !6 = $average
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL_BY_NAME                                       'getPrice'
          1        SEND_VAL_EX                                              'https%3A%2F%2Fwww.bitstamp.net%2Fapi%2Fv2%2Fticker%2Fbtcusd%2F'
          2        DO_FCALL                                      0  $7      
          3        ASSIGN                                                   !0, $7
    4     4        FETCH_DIM_R                                      ~10     !0, 'last'
          5        ASSIGN_DIM                                               !1, 2
          6        OP_DATA                                                  ~10
    7     7        INIT_FCALL_BY_NAME                                       'getPrice'
          8        SEND_VAL_EX                                              'https%3A%2F%2Fblockchain.info%2Fticker'
          9        DO_FCALL                                      0  $11     
         10        ASSIGN                                                   !2, $11
    8    11        FETCH_DIM_R                                      ~14     !2, 'USD'
         12        FETCH_DIM_R                                      ~15     ~14, 'last'
         13        ASSIGN_DIM                                               !1, 3
         14        OP_DATA                                                  ~15
   11    15        INIT_FCALL_BY_NAME                                       'getPrice'
         16        SEND_VAL_EX                                              'https%3A%2F%2Fapi.cryptonator.com%2Fapi%2Fticker%2Fbtc-usd'
         17        DO_FCALL                                      0  $16     
         18        ASSIGN                                                   !3, $16
   12    19        FETCH_DIM_R                                      ~19     !3, 'ticker'
         20        FETCH_DIM_R                                      ~20     ~19, 'price'
         21        ASSIGN_DIM                                               !1, 4
         22        OP_DATA                                                  ~20
   14    23        ASSIGN                                                   !4, 0
   15    24        ASSIGN                                                   !5, 0
         25      > JMP                                                      ->29
   16    26    >   FETCH_DIM_R                                      ~23     !1, !5
         27        ASSIGN_OP                                     1          !4, ~23
   15    28        PRE_INC                                                  !5
         29    >   FETCH_DIM_R                                      ~26     !1, !5
         30        COUNT                                            ~27     ~26
         31        IS_SMALLER                                               !5, ~27
         32      > JMPNZ                                                    ~28, ->26
   18    33    >   FETCH_DIM_R                                      ~29     !1, !5
         34        COUNT                                            ~30     ~29
         35        DIV                                              ~31     !4, ~30
         36        ASSIGN                                                   !6, ~31
   19    37      > RETURN                                                   !6
   20    38*     > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.69 ms | 1399 KiB | 13 Q