3v4l.org

run code in 500+ PHP versions simultaneously
<?php $params = [ ['Однокомнатная', 'Двухкомнатная', 'Трехкомнатная'], ['Новостройка', 'Вторичка', 'Сталинка'], ['50m2', '55m2', '60m2'], ['Под ключ', 'Капитальный', 'Косметический'], ]; function combine($left, $right){ $final = []; foreach($left as $v){ foreach($right as $vv){ $final[] = implode(',', [$v, $vv]); } } return $final; } $r = array_reduce($params, function($acc, $item) { return $acc ? combine($acc, $item) : $item; }, []); var_dump($r);

Abusive script

This script was stopped while abusing our resources

Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iC6uv
function name:  (null)
number of ops:  12
compiled vars:  !0 = $params, !1 = $r
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   21     1        INIT_FCALL                                                   'array_reduce'
          2        SEND_VAR                                                     !0
          3        DECLARE_LAMBDA_FUNCTION                              ~3      [0]
   23     4        SEND_VAL                                                     ~3
          5        SEND_VAL                                                     <array>
   21     6        DO_ICALL                                             $4      
          7        ASSIGN                                                       !1, $4
   25     8        INIT_FCALL                                                   'var_dump'
          9        SEND_VAR                                                     !1
         10        DO_ICALL                                                     
         11      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 9
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iC6uv
function name:  {closure:/in/iC6uv:21}
number of ops:  12
compiled vars:  !0 = $acc, !1 = $item
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   21     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   22     2      > JMPZ                                                         !0, ->9
          3    >   INIT_FCALL                                                   'combine'
          4        SEND_VAR                                                     !0
          5        SEND_VAR                                                     !1
          6        DO_FCALL                                          0  $2      
          7        QM_ASSIGN                                            ~3      $2
          8      > JMP                                                          ->10
          9    >   QM_ASSIGN                                            ~3      !1
         10    > > RETURN                                                       ~3
   23    11*     > RETURN                                                       null

End of Dynamic Function 0

Function combine:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 15
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 15
Branch analysis from position: 5
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 13
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 13
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 13
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/iC6uv
function name:  combine
number of ops:  18
compiled vars:  !0 = $left, !1 = $right, !2 = $final, !3 = $v, !4 = $vv
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   11     2        ASSIGN                                                       !2, <array>
   12     3      > FE_RESET_R                                           $6      !0, ->15
          4    > > FE_FETCH_R                                                   $6, !3, ->15
   13     5    > > FE_RESET_R                                           $7      !1, ->13
          6    > > FE_FETCH_R                                                   $7, !4, ->13
   14     7    >   INIT_ARRAY                                           ~9      !3
          8        ADD_ARRAY_ELEMENT                                    ~9      !4
          9        FRAMELESS_ICALL_2                implode             ~10     '%2C', ~9
         10        ASSIGN_DIM                                                   !2
         11        OP_DATA                                                      ~10
   13    12      > JMP                                                          ->6
         13    >   FE_FREE                                                      $7
   12    14      > JMP                                                          ->4
         15    >   FE_FREE                                                      $6
   18    16      > RETURN                                                       !2
   19    17*     > RETURN                                                       null

End of function combine

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
226.36 ms | 2738 KiB | 11 Q