3v4l.org

run code in 300+ PHP versions simultaneously
<?php $curl_response = '{ "options": { "ranking_metric": "paid_impressions", "time_interval": "day", "report_type": "time", "filters": { "pid": "2759" }, "data_source": "detailed", "format": "json", "end_date": "2018-10-28 23:59", "columns": ["paid_impressions", "revenue"], "time_zone": "UTC", "start_date": "2018-10-26 00:00" }, "api_url": "http://udmserve.com/udm/radalytics_api.cpx?action=report&api_key=xxxx&api_key=xxxx", "time": 1540989662, "rows": [{ "paid_impressions": "18136", "timestamp": "2018-10-26 00:00", "_combined_val": "", "ranking_col": "49046", "revenue": "28.461629999999985", "rank": "1", "f0_": "" }, { "paid_impressions": "14432", "timestamp": "2018-10-27 00:00", "_combined_val": "", "ranking_col": "49046", "revenue": "25.707970000000017", "rank": "1", "f0_": "" }, { "paid_impressions": "16478", "timestamp": "2018-10-28 00:00", "_combined_val": "", "ranking_col": "49046", "revenue": "29.07676000000002", "rank": "1", "f0_": "" }] }'; $array = json_decode($curl_response,true); foreach($array['rows'] as $arr){ echo explode(' ',$arr['timestamp'])[0].'-'.number_format((float)$arr['revenue'], 2, '.', '').' USD'.PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 29
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 29
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
filename:       /in/eUavL
function name:  (null)
number of ops:  31
compiled vars:  !0 = $curl_response, !1 = $array, !2 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%7B%0A%09%22options%22%3A+%7B%0A%09%09%22ranking_metric%22%3A+%22paid_impressions%22%2C%0A%09%09%22time_interval%22%3A+%22day%22%2C%0A%09%09%22report_type%22%3A+%22time%22%2C%0A%09%09%22filters%22%3A+%7B%0A%09%09%09%22pid%22%3A+%222759%22%0A%09%09%7D%2C%0A%09%09%22data_source%22%3A+%22detailed%22%2C%0A%09%09%22format%22%3A+%22json%22%2C%0A%09%09%22end_date%22%3A+%222018-10-28+23%3A59%22%2C%0A%09%09%22columns%22%3A+%5B%22paid_impressions%22%2C+%22revenue%22%5D%2C%0A%09%09%22time_zone%22%3A+%22UTC%22%2C%0A%09%09%22start_date%22%3A+%222018-10-26+00%3A00%22%0A%09%7D%2C%0A%09%22api_url%22%3A+%22http%3A%2F%2Fudmserve.com%2Fudm%2Fradalytics_api.cpx%3Faction%3Dreport%26api_key%3Dxxxx%26api_key%3Dxxxx%22%2C%0A%09%22time%22%3A+1540989662%2C%0A%09%22rows%22%3A+%5B%7B%0A%09%09%22paid_impressions%22%3A+%2218136%22%2C%0A%09%09%22timestamp%22%3A+%222018-10-26+00%3A00%22%2C%0A%09%09%22_combined_val%22%3A+%22%22%2C%0A%09%09%22ranking_col%22%3A+%2249046%22%2C%0A%09%09%22revenue%22%3A+%2228.461629999999985%22%2C%0A%09%09%22rank%22%3A+%221%22%2C%0A%09%09%22f0_%22%3A+%22%22%0A%09%7D%2C+%7B%0A%09%09%22paid_impressions%22%3A+%2214432%22%2C%0A%09%09%22timestamp%22%3A+%222018-10-27+00%3A00%22%2C%0A%09%09%22_combined_val%22%3A+%22%22%2C%0A%09%09%22ranking_col%22%3A+%2249046%22%2C%0A%09%09%22revenue%22%3A+%2225.707970000000017%22%2C%0A%09%09%22rank%22%3A+%221%22%2C%0A%09%09%22f0_%22%3A+%22%22%0A%09%7D%2C+%7B%0A%09%09%22paid_impressions%22%3A+%2216478%22%2C%0A%09%09%22timestamp%22%3A+%222018-10-28+00%3A00%22%2C%0A%09%09%22_combined_val%22%3A+%22%22%2C%0A%09%09%22ranking_col%22%3A+%2249046%22%2C%0A%09%09%22revenue%22%3A+%2229.07676000000002%22%2C%0A%09%09%22rank%22%3A+%221%22%2C%0A%09%09%22f0_%22%3A+%22%22%0A%09%7D%5D%0A%7D'
   47     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
   48     6        FETCH_DIM_R                                      ~6      !1, 'rows'
          7      > FE_RESET_R                                       $7      ~6, ->29
          8    > > FE_FETCH_R                                               $7, !2, ->29
   49     9    >   INIT_FCALL                                               'explode'
         10        SEND_VAL                                                 '+'
         11        FETCH_DIM_R                                      ~8      !2, 'timestamp'
         12        SEND_VAL                                                 ~8
         13        DO_ICALL                                         $9      
         14        FETCH_DIM_R                                      ~10     $9, 0
         15        CONCAT                                           ~11     ~10, '-'
         16        INIT_FCALL                                               'number_format'
         17        FETCH_DIM_R                                      ~12     !2, 'revenue'
         18        CAST                                          5  ~13     ~12
         19        SEND_VAL                                                 ~13
         20        SEND_VAL                                                 2
         21        SEND_VAL                                                 '.'
         22        SEND_VAL                                                 ''
         23        DO_ICALL                                         $14     
         24        CONCAT                                           ~15     ~11, $14
         25        CONCAT                                           ~16     ~15, '+USD'
         26        CONCAT                                           ~17     ~16, '%0A'
         27        ECHO                                                     ~17
   48    28      > JMP                                                      ->8
         29    >   FE_FREE                                                  $7
   50    30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.51 ms | 1005 KiB | 16 Q