3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = [ ['p_description' => 'Eggs', 'p_category' => 'Food', 'p_cost' => 20, 'p_stock' => 20], ['p_description' => 'Coca Cola', 'p_category' => 'Drinks', 'p_cost' => 5, 'p_stock' => 30], ]; echo array_reduce($result, function($carry, $row) { $carry .= (!$carry ? '' : ', ') . '[' . implode(', ', $row) . ']'; return $carry; });
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mopB3
function name:  (null)
number of ops:  8
compiled vars:  !0 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    8     1        INIT_FCALL                                               'array_reduce'
          2        SEND_VAR                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
   11     4        SEND_VAL                                                 ~2
    8     5        DO_ICALL                                         $3      
   11     6        ECHO                                                     $3
          7      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
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 = 42) Position 1 = 7
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mopB3
function name:  {closure}
number of ops:  17
compiled vars:  !0 = $carry, !1 = $row
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    9     2        BOOL_NOT                                         ~2      !0
          3      > JMPZ                                                     ~2, ->6
          4    >   QM_ASSIGN                                        ~3      ''
          5      > JMP                                                      ->7
          6    >   QM_ASSIGN                                        ~3      '%2C+'
          7    >   CONCAT                                           ~4      ~3, '%5B'
          8        INIT_FCALL                                               'implode'
          9        SEND_VAL                                                 '%2C+'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $5      
         12        CONCAT                                           ~6      ~4, $5
         13        CONCAT                                           ~7      ~6, '%5D'
         14        ASSIGN_OP                                     8          !0, ~7
   10    15      > RETURN                                                   !0
   11    16*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.77 ms | 1434 KiB | 15 Q