3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ (object)['Name' => 'Kory Kelly', 'PhoneNumber' => '(555) 555-5555'], (object)['Name' => 'Kory Kelly', 'PhoneNumber' => '(555) 555-5555'], (object)['Name' => 'Kory Kelly', 'PhoneNumber' => '(555) 555-5555X'], //different ]; foreach($arr as $key => $object){ $arr[json_encode($object)] = $object; unset($arr[$key]); } $arr = array_values($arr); var_dump($arr);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 17
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 17
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/amGMJ
function name:  (null)
number of ops:  26
compiled vars:  !0 = $arr, !1 = $object, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   CAST                                          8  ~3      <array>
          1        INIT_ARRAY                                       ~4      ~3
    5     2        CAST                                          8  ~5      <array>
          3        ADD_ARRAY_ELEMENT                                ~4      ~5
    6     4        CAST                                          8  ~6      <array>
          5        ADD_ARRAY_ELEMENT                                ~4      ~6
    3     6        ASSIGN                                                   !0, ~4
    9     7      > FE_RESET_R                                       $8      !0, ->17
          8    > > FE_FETCH_R                                       ~9      $8, !1, ->17
          9    >   ASSIGN                                                   !2, ~9
   10    10        INIT_FCALL                                               'json_encode'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $11     
         13        ASSIGN_DIM                                               !0, $11
         14        OP_DATA                                                  !1
   11    15        UNSET_DIM                                                !0, !2
    9    16      > JMP                                                      ->8
         17    >   FE_FREE                                                  $8
   13    18        INIT_FCALL                                               'array_values'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                         $13     
         21        ASSIGN                                                   !0, $13
   14    22        INIT_FCALL                                               'var_dump'
         23        SEND_VAR                                                 !0
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.18 ms | 1000 KiB | 16 Q