3v4l.org

run code in 500+ PHP versions simultaneously
<?php $records = [ [ "id" => 8, "username" => "macq", "owner" => [ [ "id" => 5, "name" => "Hyna Bora", "adress" => "ul.Baranio 17,34-567 Zadupie", "property" => [ [ "id" => 6, "name" => "Garaż", "adress" => "ul.Baranio 17,34-567 Zadupie", ] ], ], [ "id" => 6, "name" => "Kasia Doryghi", "adress" => "ul.Hellera 18,94-537 Katowice", "property" => [ [ "id" => 7, "name" => "Mieszkanie", "adress" => "ul.Hellera 18,94-537 Katowice", ] ] ] ] ] ]; foreach($records as $record){ foreach($record['owner'] as $recordowner){ if(array_key_exists("property", $recordowner)){ $Owner_names = array_column($recordowner['property'], 'name'); print_r($Owner_names); } } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 20
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 20
Branch analysis from position: 3
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 18
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 18
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 17
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 17
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 18
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/XV6aB
function name:  (null)
number of ops:  22
compiled vars:  !0 = $records, !1 = $record, !2 = $recordowner, !3 = $Owner_names
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   46     1      > FE_RESET_R                                           $5      !0, ->20
          2    > > FE_FETCH_R                                                   $5, !1, ->20
   49     3    >   FETCH_DIM_R                                          ~6      !1, 'owner'
          4      > FE_RESET_R                                           $7      ~6, ->18
          5    > > FE_FETCH_R                                                   $7, !2, ->18
   50     6    >   ARRAY_KEY_EXISTS                                             'property', !2
          7      > JMPZ                                                         ~8, ->17
   51     8    >   INIT_FCALL                                                   'array_column'
          9        FETCH_DIM_R                                          ~9      !2, 'property'
         10        SEND_VAL                                                     ~9
         11        SEND_VAL                                                     'name'
         12        DO_ICALL                                             $10     
         13        ASSIGN                                                       !3, $10
   52    14        INIT_FCALL                                                   'print_r'
         15        SEND_VAR                                                     !3
         16        DO_ICALL                                                     
   49    17    > > JMP                                                          ->5
         18    >   FE_FREE                                                      $7
   46    19      > JMP                                                          ->2
         20    >   FE_FREE                                                      $5
   57    21      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
165.54 ms | 2221 KiB | 15 Q