3v4l.org

run code in 300+ PHP versions simultaneously
<?php $categories_arr = Category::all(); foreach ($categories_arr as $category) { echo $category['id']."<br>"; $parent_id = Category::where('parent_id', '=', $category['id'])->value('id'); if ($parent_id !== null) { echo "--".$parent_id."<br>"; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 25
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 25
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 24
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 24
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/R0X1i
function name:  (null)
number of ops:  27
compiled vars:  !0 = $categories_arr, !1 = $category, !2 = $parent_id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_STATIC_METHOD_CALL                                  'Category', 'all'
          1        DO_FCALL                                      0  $3      
          2        ASSIGN                                                   !0, $3
    4     3      > FE_RESET_R                                       $5      !0, ->25
          4    > > FE_FETCH_R                                               $5, !1, ->25
    5     5    >   FETCH_DIM_R                                      ~6      !1, 'id'
          6        CONCAT                                           ~7      ~6, '%3Cbr%3E'
          7        ECHO                                                     ~7
    6     8        INIT_STATIC_METHOD_CALL                                  'Category', 'where'
          9        SEND_VAL_EX                                              'parent_id'
         10        SEND_VAL_EX                                              '%3D'
         11        CHECK_FUNC_ARG                                           
         12        FETCH_DIM_FUNC_ARG                               $8      !1, 'id'
         13        SEND_FUNC_ARG                                            $8
         14        DO_FCALL                                      0  $9      
         15        INIT_METHOD_CALL                                         $9, 'value'
         16        SEND_VAL_EX                                              'id'
         17        DO_FCALL                                      0  $10     
         18        ASSIGN                                                   !2, $10
    7    19        TYPE_CHECK                                  1020          !2
         20      > JMPZ                                                     ~12, ->24
    8    21    >   CONCAT                                           ~13     '--', !2
         22        CONCAT                                           ~14     ~13, '%3Cbr%3E'
         23        ECHO                                                     ~14
    4    24    > > JMP                                                      ->4
         25    >   FE_FREE                                                  $5
   10    26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.03 ms | 1008 KiB | 13 Q