3v4l.org

run code in 300+ PHP versions simultaneously
<?php $places = ['Places'=>[]]; $book1 = new stdClass; $book1->PlaceId = 837; $book1->Name = "United Arab Emirates"; $book1->Type = "Country"; $book2 = new stdClass; $book2->PlaceId = 838; $book2->Name = "Afganistant"; $book2->Type = "Country"; $book3 = new stdClass; $book3->PlaceId = 839; $book3->Name = "Canada"; $book3->Type = "Country"; $places['Places'][] = $book1; $places['Places'][] = $book2; $places['Places'][] = $book3; //print_r($places); $key = array_search(839, array_column($places['Places'], 'PlaceId')); print_r($places['Places'][$key]); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RsPr4
function name:  (null)
number of ops:  53
compiled vars:  !0 = $places, !1 = $book1, !2 = $book2, !3 = $book3, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        NEW                                              $6      'stdClass'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $6
    4     4        ASSIGN_OBJ                                               !1, 'PlaceId'
          5        OP_DATA                                                  837
    5     6        ASSIGN_OBJ                                               !1, 'Name'
          7        OP_DATA                                                  'United+Arab+Emirates'
    6     8        ASSIGN_OBJ                                               !1, 'Type'
          9        OP_DATA                                                  'Country'
    7    10        NEW                                              $12     'stdClass'
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !2, $12
    8    13        ASSIGN_OBJ                                               !2, 'PlaceId'
         14        OP_DATA                                                  838
    9    15        ASSIGN_OBJ                                               !2, 'Name'
         16        OP_DATA                                                  'Afganistant'
   10    17        ASSIGN_OBJ                                               !2, 'Type'
         18        OP_DATA                                                  'Country'
   11    19        NEW                                              $18     'stdClass'
         20        DO_FCALL                                      0          
         21        ASSIGN                                                   !3, $18
   12    22        ASSIGN_OBJ                                               !3, 'PlaceId'
         23        OP_DATA                                                  839
   13    24        ASSIGN_OBJ                                               !3, 'Name'
         25        OP_DATA                                                  'Canada'
   14    26        ASSIGN_OBJ                                               !3, 'Type'
         27        OP_DATA                                                  'Country'
   15    28        FETCH_DIM_W                                      $24     !0, 'Places'
         29        ASSIGN_DIM                                               $24
         30        OP_DATA                                                  !1
   16    31        FETCH_DIM_W                                      $26     !0, 'Places'
         32        ASSIGN_DIM                                               $26
         33        OP_DATA                                                  !2
   17    34        FETCH_DIM_W                                      $28     !0, 'Places'
         35        ASSIGN_DIM                                               $28
         36        OP_DATA                                                  !3
   20    37        INIT_FCALL                                               'array_search'
         38        SEND_VAL                                                 839
         39        INIT_FCALL                                               'array_column'
         40        FETCH_DIM_R                                      ~30     !0, 'Places'
         41        SEND_VAL                                                 ~30
         42        SEND_VAL                                                 'PlaceId'
         43        DO_ICALL                                         $31     
         44        SEND_VAR                                                 $31
         45        DO_ICALL                                         $32     
         46        ASSIGN                                                   !4, $32
   21    47        INIT_FCALL                                               'print_r'
         48        FETCH_DIM_R                                      ~34     !0, 'Places'
         49        FETCH_DIM_R                                      ~35     ~34, !4
         50        SEND_VAL                                                 ~35
         51        DO_ICALL                                                 
   23    52      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
233.07 ms | 1017 KiB | 16 Q