3v4l.org

run code in 500+ PHP versions simultaneously
<?php $data = json_decode('[ {"expiration": "0000-00", "quantity": -50}, {"expiration": "2023-02", "quantity": 100}, {"expiration": "2022-03", "quantity": 50} ]'); // extract 'expiration', remove '0000-00' $data = array_filter(array_column($data, 'expiration'), fn($item) => $item != '0000-00'); sort($data); var_dump(reset($data)); // string(7) "2023-03"
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IRMsf
function name:  (null)
number of ops:  24
compiled vars:  !0 = $data
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                                   'json_decode'
          1        SEND_VAL                                                     '%5B%0A+%7B%22expiration%22%3A+%220000-00%22%2C+%22quantity%22%3A+-50%7D%2C%0A+%7B%22expiration%22%3A+%222023-02%22%2C+%22quantity%22%3A+100%7D%2C%0A+%7B%22expiration%22%3A+%222022-03%22%2C+%22quantity%22%3A+50%7D%0A%5D'
          2        DO_ICALL                                             $1      
          3        ASSIGN                                                       !0, $1
   10     4        INIT_FCALL                                                   'array_filter'
          5        INIT_FCALL                                                   'array_column'
          6        SEND_VAR                                                     !0
          7        SEND_VAL                                                     'expiration'
          8        DO_ICALL                                             $3      
          9        SEND_VAR                                                     $3
         10        DECLARE_LAMBDA_FUNCTION                              ~4      [0]
         11        SEND_VAL                                                     ~4
         12        DO_ICALL                                             $5      
         13        ASSIGN                                                       !0, $5
   11    14        INIT_FCALL                                                   'sort'
         15        SEND_REF                                                     !0
         16        DO_ICALL                                                     
   12    17        INIT_FCALL                                                   'var_dump'
         18        INIT_FCALL                                                   'reset'
         19        SEND_REF                                                     !0
         20        DO_ICALL                                             $8      
         21        SEND_VAR                                                     $8
         22        DO_ICALL                                                     
         23      > 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/IRMsf
function name:  {closure:/in/IRMsf:10}
number of ops:  4
compiled vars:  !0 = $item
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   RECV                                                 !0      
          1        IS_NOT_EQUAL                                         ~1      !0, '0000-00'
          2      > RETURN                                                       ~1
          3*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
159.77 ms | 1899 KiB | 19 Q