3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = '{ "instrument":"EUR_USD", "granularity":"D", "candles":[ { "complete":true, "volume":32813, "time":"2017-01-02T22:00:00.000000000Z", "ask":{ "o":"1.04711", "h":"1.04908", "l":"1.03413", "c":"1.04061" } }, { "complete":true, "volume":34501, "time":"2017-01-03T22:00:00.000000000Z", "ask":{ "o":"1.04076", "h":"1.05009", "l":"1.03907", "c":"1.04908" } }, { "complete":true, "volume":52627, "time":"2017-01-04T22:00:00.000000000Z", "ask":{ "o":"1.04911", "h":"1.06161", "l":"1.04816", "c":"1.06083" }}]}'; $arr = json_decode($data,true); $c = array_map( function ($in){ return $in['ask']['c']; }, $arr['candles']); sort($c); echo 'Min is: '.current($c)."\n"; echo 'Max is: '.end($c);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YsJ3a
function name:  (null)
number of ops:  28
compiled vars:  !0 = $data, !1 = $arr, !2 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%7B%0A%22instrument%22%3A%22EUR_USD%22%2C%0A%22granularity%22%3A%22D%22%2C%0A%22candles%22%3A%5B%0A%7B%0A%22complete%22%3Atrue%2C%0A%22volume%22%3A32813%2C%0A%22time%22%3A%222017-01-02T22%3A00%3A00.000000000Z%22%2C%0A%22ask%22%3A%7B%0A%22o%22%3A%221.04711%22%2C%0A%22h%22%3A%221.04908%22%2C%0A%22l%22%3A%221.03413%22%2C%0A%22c%22%3A%221.04061%22%0A%7D%0A%7D%2C%0A%7B%0A%22complete%22%3Atrue%2C%0A%22volume%22%3A34501%2C%0A%22time%22%3A%222017-01-03T22%3A00%3A00.000000000Z%22%2C%0A%22ask%22%3A%7B%0A%22o%22%3A%221.04076%22%2C%0A%22h%22%3A%221.05009%22%2C%0A%22l%22%3A%221.03907%22%2C%0A%22c%22%3A%221.04908%22%0A%7D%0A%7D%2C%0A%7B%0A%22complete%22%3Atrue%2C%0A%22volume%22%3A52627%2C%0A%22time%22%3A%222017-01-04T22%3A00%3A00.000000000Z%22%2C%0A%22ask%22%3A%7B%0A%22o%22%3A%221.04911%22%2C%0A%22h%22%3A%221.06161%22%2C%0A%22l%22%3A%221.04816%22%2C%0A%22c%22%3A%221.06083%22%0A%7D%7D%5D%7D'
   38     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
   39     6        INIT_FCALL                                               'array_map'
          7        DECLARE_LAMBDA_FUNCTION                          ~6      [0]
   41     8        SEND_VAL                                                 ~6
          9        FETCH_DIM_R                                      ~7      !1, 'candles'
         10        SEND_VAL                                                 ~7
   39    11        DO_ICALL                                         $8      
         12        ASSIGN                                                   !2, $8
   42    13        INIT_FCALL                                               'sort'
         14        SEND_REF                                                 !2
         15        DO_ICALL                                                 
   43    16        INIT_FCALL                                               'current'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                         $11     
         19        CONCAT                                           ~12     'Min+is%3A+', $11
         20        CONCAT                                           ~13     ~12, '%0A'
         21        ECHO                                                     ~13
   44    22        INIT_FCALL                                               'end'
         23        SEND_REF                                                 !2
         24        DO_ICALL                                         $14     
         25        CONCAT                                           ~15     'Max+is%3A+', $14
         26        ECHO                                                     ~15
         27      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YsJ3a
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $in
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   39     0  E >   RECV                                             !0      
   40     1        FETCH_DIM_R                                      ~1      !0, 'ask'
          2        FETCH_DIM_R                                      ~2      ~1, 'c'
          3      > RETURN                                                   ~2
   41     4*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.11 ms | 1020 KiB | 18 Q