3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = new stdClass; $a->id = 2; $b = new stdClass; $b->id = 2; $case1 = array_unique([$a, $b], SORT_REGULAR); $storage = new SplObjectStorage(); $storage->attach($a); $storage->attach($b); $case2 = iterator_to_array($storage); var_dump($case1, $case2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hQKL5
function name:  (null)
number of ops:  35
compiled vars:  !0 = $a, !1 = $b, !2 = $case1, !3 = $storage, !4 = $case2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $5      'stdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $5
    5     3        ASSIGN_OBJ                                               !0, 'id'
          4        OP_DATA                                                  2
    7     5        NEW                                              $9      'stdClass'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $9
    9     8        ASSIGN_OBJ                                               !1, 'id'
          9        OP_DATA                                                  2
   11    10        INIT_FCALL                                               'array_unique'
         11        INIT_ARRAY                                       ~13     !0
         12        ADD_ARRAY_ELEMENT                                ~13     !1
         13        SEND_VAL                                                 ~13
         14        SEND_VAL                                                 0
         15        DO_ICALL                                         $14     
         16        ASSIGN                                                   !2, $14
   13    17        NEW                                              $16     'SplObjectStorage'
         18        DO_FCALL                                      0          
         19        ASSIGN                                                   !3, $16
   15    20        INIT_METHOD_CALL                                         !3, 'attach'
         21        SEND_VAR_EX                                              !0
         22        DO_FCALL                                      0          
   16    23        INIT_METHOD_CALL                                         !3, 'attach'
         24        SEND_VAR_EX                                              !1
         25        DO_FCALL                                      0          
   18    26        INIT_FCALL                                               'iterator_to_array'
         27        SEND_VAR                                                 !3
         28        DO_ICALL                                         $21     
         29        ASSIGN                                                   !4, $21
   21    30        INIT_FCALL                                               'var_dump'
         31        SEND_VAR                                                 !2
         32        SEND_VAR                                                 !4
         33        DO_ICALL                                                 
         34      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
187.51 ms | 1462 KiB | 16 Q