3v4l.org

run code in 300+ PHP versions simultaneously
<?php function category_page($id, Request $request) { $category = $this->category->find($id); $name = $category->name; $description = $category->description; $catalog = $this->category; $page = $this->page; $products = Products::where('category_id', $id)->get(); //var_dump($products); $sezon = Products::select('sezon')->get()->unique('sezon')->pluck('sezon'); $brands = Brands::has('products')->pluck('name'); $material = Products::select('material')->get()->unique('material')->pluck('material'); if ($request->has('brand')) { $brands_filter_arr = $request->brand; foreach ($brands_filter_arr as $brands_item) { $brand_id = Brands::where('name', 'like', "%$brands_item%")->get()->pluck('id'); $products_new[] = Products::where('brand_id', $brand_id)->get()->all(); } $products = $products_new; //dd($products); } //var_dump($brands); return view('category', ['name' => $name, 'description' => $description, 'catalog' => $catalog, 'page' => $page, 'products' => $products, 'sezon' => $sezon, 'material' => $material, 'brands' => $brands]); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5C1TO
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E > > RETURN                                                   1

Function category_page:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 60, Position 2 = 91
Branch analysis from position: 60
2 jumps found. (Code = 77) Position 1 = 63, Position 2 = 89
Branch analysis from position: 63
2 jumps found. (Code = 78) Position 1 = 64, Position 2 = 89
Branch analysis from position: 64
1 jumps found. (Code = 42) Position 1 = 63
Branch analysis from position: 63
Branch analysis from position: 89
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 89
Branch analysis from position: 91
filename:       /in/5C1TO
function name:  category_page
number of ops:  105
compiled vars:  !0 = $id, !1 = $request, !2 = $category, !3 = $name, !4 = $description, !5 = $catalog, !6 = $page, !7 = $products, !8 = $sezon, !9 = $brands, !10 = $material, !11 = $brands_filter_arr, !12 = $brands_item, !13 = $brand_id, !14 = $products_new
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        FETCH_THIS                                       $15     
          3        FETCH_OBJ_R                                      ~16     $15, 'category'
          4        INIT_METHOD_CALL                                         ~16, 'find'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0  $17     
          7        ASSIGN                                                   !2, $17
    5     8        FETCH_OBJ_R                                      ~19     !2, 'name'
          9        ASSIGN                                                   !3, ~19
    6    10        FETCH_OBJ_R                                      ~21     !2, 'description'
         11        ASSIGN                                                   !4, ~21
    7    12        FETCH_THIS                                       $23     
         13        FETCH_OBJ_R                                      ~24     $23, 'category'
         14        ASSIGN                                                   !5, ~24
    8    15        FETCH_THIS                                       $26     
         16        FETCH_OBJ_R                                      ~27     $26, 'page'
         17        ASSIGN                                                   !6, ~27
    9    18        INIT_STATIC_METHOD_CALL                                  'Products', 'where'
         19        SEND_VAL_EX                                              'category_id'
         20        SEND_VAR_EX                                              !0
         21        DO_FCALL                                      0  $29     
         22        INIT_METHOD_CALL                                         $29, 'get'
         23        DO_FCALL                                      0  $30     
         24        ASSIGN                                                   !7, $30
   13    25        INIT_STATIC_METHOD_CALL                                  'Products', 'select'
         26        SEND_VAL_EX                                              'sezon'
         27        DO_FCALL                                      0  $32     
         28        INIT_METHOD_CALL                                         $32, 'get'
         29        DO_FCALL                                      0  $33     
         30        INIT_METHOD_CALL                                         $33, 'unique'
         31        SEND_VAL_EX                                              'sezon'
         32        DO_FCALL                                      0  $34     
         33        INIT_METHOD_CALL                                         $34, 'pluck'
         34        SEND_VAL_EX                                              'sezon'
         35        DO_FCALL                                      0  $35     
         36        ASSIGN                                                   !8, $35
   14    37        INIT_STATIC_METHOD_CALL                                  'Brands', 'has'
         38        SEND_VAL_EX                                              'products'
         39        DO_FCALL                                      0  $37     
         40        INIT_METHOD_CALL                                         $37, 'pluck'
         41        SEND_VAL_EX                                              'name'
         42        DO_FCALL                                      0  $38     
         43        ASSIGN                                                   !9, $38
   15    44        INIT_STATIC_METHOD_CALL                                  'Products', 'select'
         45        SEND_VAL_EX                                              'material'
         46        DO_FCALL                                      0  $40     
         47        INIT_METHOD_CALL                                         $40, 'get'
         48        DO_FCALL                                      0  $41     
         49        INIT_METHOD_CALL                                         $41, 'unique'
         50        SEND_VAL_EX                                              'material'
         51        DO_FCALL                                      0  $42     
         52        INIT_METHOD_CALL                                         $42, 'pluck'
         53        SEND_VAL_EX                                              'material'
         54        DO_FCALL                                      0  $43     
         55        ASSIGN                                                   !10, $43
   18    56        INIT_METHOD_CALL                                         !1, 'has'
         57        SEND_VAL_EX                                              'brand'
         58        DO_FCALL                                      0  $45     
         59      > JMPZ                                                     $45, ->91
   19    60    >   FETCH_OBJ_R                                      ~46     !1, 'brand'
         61        ASSIGN                                                   !11, ~46
   20    62      > FE_RESET_R                                       $48     !11, ->89
         63    > > FE_FETCH_R                                               $48, !12, ->89
   21    64    >   INIT_STATIC_METHOD_CALL                                  'Brands', 'where'
         65        SEND_VAL_EX                                              'name'
         66        SEND_VAL_EX                                              'like'
         67        ROPE_INIT                                     3  ~50     '%25'
         68        ROPE_ADD                                      1  ~50     ~50, !12
         69        ROPE_END                                      2  ~49     ~50, '%25'
         70        SEND_VAL_EX                                              ~49
         71        DO_FCALL                                      0  $52     
         72        INIT_METHOD_CALL                                         $52, 'get'
         73        DO_FCALL                                      0  $53     
         74        INIT_METHOD_CALL                                         $53, 'pluck'
         75        SEND_VAL_EX                                              'id'
         76        DO_FCALL                                      0  $54     
         77        ASSIGN                                                   !13, $54
   22    78        INIT_STATIC_METHOD_CALL                                  'Products', 'where'
         79        SEND_VAL_EX                                              'brand_id'
         80        SEND_VAR_EX                                              !13
         81        DO_FCALL                                      0  $57     
         82        INIT_METHOD_CALL                                         $57, 'get'
         83        DO_FCALL                                      0  $58     
         84        INIT_METHOD_CALL                                         $58, 'all'
         85        DO_FCALL                                      0  $59     
         86        ASSIGN_DIM                                               !14
         87        OP_DATA                                                  $59
   20    88      > JMP                                                      ->63
         89    >   FE_FREE                                                  $48
   24    90        ASSIGN                                                   !7, !14
   32    91    >   INIT_FCALL_BY_NAME                                       'view'
         92        SEND_VAL_EX                                              'category'
         93        INIT_ARRAY                                       ~61     !3, 'name'
         94        ADD_ARRAY_ELEMENT                                ~61     !4, 'description'
         95        ADD_ARRAY_ELEMENT                                ~61     !5, 'catalog'
         96        ADD_ARRAY_ELEMENT                                ~61     !6, 'page'
         97        ADD_ARRAY_ELEMENT                                ~61     !7, 'products'
         98        ADD_ARRAY_ELEMENT                                ~61     !8, 'sezon'
         99        ADD_ARRAY_ELEMENT                                ~61     !10, 'material'
        100        ADD_ARRAY_ELEMENT                                ~61     !9, 'brands'
        101        SEND_VAL_EX                                              ~61
        102        DO_FCALL                                      0  $62     
        103      > RETURN                                                   $62
   33   104*     > RETURN                                                   null

End of function category_page

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
287.77 ms | 1016 KiB | 13 Q