3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "2014-10-10,2689,100.20,99.33,2613 2014-10-13,2628,101.10,99.98,2741 2014-10-14,2741,100.06,99.20,2658 2014-10-15,2741,100.06,99.20,2658"; $date = array_reduce(explode(' ', $string), function($carry, $item) { $carry[] = explode(',', $item)[0]; return $carry; }); var_dump($date);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IaF3s
function name:  (null)
number of ops:  15
compiled vars:  !0 = $string, !1 = $date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '2014-10-10%2C2689%2C100.20%2C99.33%2C2613+2014-10-13%2C2628%2C101.10%2C99.98%2C2741+2014-10-14%2C2741%2C100.06%2C99.20%2C2658+2014-10-15%2C2741%2C100.06%2C99.20%2C2658'
    4     1        INIT_FCALL                                               'array_reduce'
          2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '+'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
          6        SEND_VAR                                                 $3
          7        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
          8        SEND_VAL                                                 ~4
          9        DO_ICALL                                         $5      
         10        ASSIGN                                                   !1, $5
    5    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                                 
         14      > 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/IaF3s
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $carry, !1 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '%2C'
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $3      
          6        FETCH_DIM_R                                      ~4      $3, 0
          7        ASSIGN_DIM                                               !0
          8        OP_DATA                                                  ~4
          9      > RETURN                                                   !0
         10*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
236.08 ms | 1001 KiB | 16 Q