3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{ "dates": [{ "orderId": 60132, "typeId": 7, "date": "2021-06-03T00:00:00+02:00" }, { "orderId": 60132, "typeId": 11, "date": "2021-05-28T00:00:00+02:00" }, { "orderId": 60132, "typeId": 16, "date": "2021-05-27T20:20:28+02:00" }, { "orderId": 60132, "typeId": 2, "date": "2021-05-27T20:19:21+02:00" }, { "orderId": 60132, "typeId": 4, "date": "2021-06-02T15:31:50+02:00" } ] }'; $arr = json_decode($json, true); $result = array_filter( array_map( function ($record) {if ($record['typeId'] == 11) return $record['date'];}, $arr['dates'] ) ); var_dump($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MPZD8
function name:  (null)
number of ops:  20
compiled vars:  !0 = $json, !1 = $arr, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%7B%0A%09%22dates%22%3A+%5B%7B%0A%09%09%09%22orderId%22%3A+60132%2C%0A%09%09%09%22typeId%22%3A+7%2C%0A%09%09%09%22date%22%3A+%222021-06-03T00%3A00%3A00%2B02%3A00%22%0A%09%09%7D%2C%0A%09%09%7B%0A%09%09%09%22orderId%22%3A+60132%2C%0A%09%09%09%22typeId%22%3A+11%2C%0A%09%09%09%22date%22%3A+%222021-05-28T00%3A00%3A00%2B02%3A00%22%0A%09%09%7D%2C%0A%09%09%7B%0A%09%09%09%22orderId%22%3A+60132%2C%0A%09%09%09%22typeId%22%3A+16%2C%0A%09%09%09%22date%22%3A+%222021-05-27T20%3A20%3A28%2B02%3A00%22%0A%09%09%7D%2C%0A%09%09%7B%0A%09%09%09%22orderId%22%3A+60132%2C%0A%09%09%09%22typeId%22%3A+2%2C%0A%09%09%09%22date%22%3A+%222021-05-27T20%3A19%3A21%2B02%3A00%22%0A%09%09%7D%2C%0A%09%09%7B%0A%09%09%09%22orderId%22%3A+60132%2C%0A%09%09%09%22typeId%22%3A+4%2C%0A%09%09%09%22date%22%3A+%222021-06-02T15%3A31%3A50%2B02%3A00%22%0A%09%09%7D%0A%09%5D%0A%7D'
   31     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
   32     6        INIT_FCALL                                               'array_filter'
   33     7        INIT_FCALL                                               'array_map'
   34     8        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FMPZD8%3A34%240'
          9        SEND_VAL                                                 ~6
         10        FETCH_DIM_R                                      ~7      !1, 'dates'
         11        SEND_VAL                                                 ~7
         12        DO_ICALL                                         $8      
         13        SEND_VAR                                                 $8
         14        DO_ICALL                                         $9      
   32    15        ASSIGN                                                   !2, $9
   38    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FMPZD8%3A34%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MPZD8
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $record
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   RECV                                             !0      
          1        FETCH_DIM_R                                      ~1      !0, 'typeId'
          2        IS_EQUAL                                                 ~1, 11
          3      > JMPZ                                                     ~2, ->6
          4    >   FETCH_DIM_R                                      ~3      !0, 'date'
          5      > RETURN                                                   ~3
          6    > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FMPZD8%3A34%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.38 ms | 1400 KiB | 21 Q