3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Profile { public $n; }; $p1 = new Profile(); $p1->n = "Profile #1"; $p2 = new Profile(); $p2->n = "Profile #2"; $p3 = new Profile(); $p3->n = "Profile #3"; $a1 = array($p1, $p2); $a2 = array($p2, $p3); var_dump(array_udiff($a1, $a2, function ($a, $b) { var_dump($a->n, $b->n, $a === $b); return $a === $b ? 0 : 1; })); var_dump(array_udiff($a1, $a2, function ($a, $b) { var_dump($a->n, $b->n, $a === $b); if ($a === $b) return 0; return $a > $b ? 1 : -1;}));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BA8Ap
function name:  (null)
number of ops:  40
compiled vars:  !0 = $p1, !1 = $p2, !2 = $p3, !3 = $a1, !4 = $a2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   NEW                                              $5      'Profile'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $5
          3        ASSIGN_OBJ                                               !0, 'n'
          4        OP_DATA                                                  'Profile+%231'
    6     5        NEW                                              $9      'Profile'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $9
          8        ASSIGN_OBJ                                               !1, 'n'
          9        OP_DATA                                                  'Profile+%232'
    7    10        NEW                                              $13     'Profile'
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !2, $13
         13        ASSIGN_OBJ                                               !2, 'n'
         14        OP_DATA                                                  'Profile+%233'
    9    15        INIT_ARRAY                                       ~17     !0
         16        ADD_ARRAY_ELEMENT                                ~17     !1
         17        ASSIGN                                                   !3, ~17
   10    18        INIT_ARRAY                                       ~19     !1
         19        ADD_ARRAY_ELEMENT                                ~19     !2
         20        ASSIGN                                                   !4, ~19
   12    21        INIT_FCALL                                               'var_dump'
         22        INIT_FCALL                                               'array_udiff'
         23        SEND_VAR                                                 !3
         24        SEND_VAR                                                 !4
         25        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FBA8Ap%3A12%240'
         26        SEND_VAL                                                 ~21
         27        DO_ICALL                                         $22     
         28        SEND_VAR                                                 $22
         29        DO_ICALL                                                 
   13    30        INIT_FCALL                                               'var_dump'
         31        INIT_FCALL                                               'array_udiff'
         32        SEND_VAR                                                 !3
         33        SEND_VAR                                                 !4
         34        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FBA8Ap%3A13%241'
         35        SEND_VAL                                                 ~24
         36        DO_ICALL                                         $25     
         37        SEND_VAR                                                 $25
         38        DO_ICALL                                                 
         39      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FBA8Ap%3A12%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BA8Ap
function name:  {closure}
number of ops:  17
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        INIT_FCALL                                               'var_dump'
          3        FETCH_OBJ_R                                      ~2      !0, 'n'
          4        SEND_VAL                                                 ~2
          5        FETCH_OBJ_R                                      ~3      !1, 'n'
          6        SEND_VAL                                                 ~3
          7        IS_IDENTICAL                                     ~4      !0, !1
          8        SEND_VAL                                                 ~4
          9        DO_ICALL                                                 
         10        IS_IDENTICAL                                             !0, !1
         11      > JMPZ                                                     ~6, ->14
         12    >   QM_ASSIGN                                        ~7      0
         13      > JMP                                                      ->15
         14    >   QM_ASSIGN                                        ~7      1
         15    > > RETURN                                                   ~7
         16*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FBA8Ap%3A12%240

Function %00%7Bclosure%7D%2Fin%2FBA8Ap%3A13%241:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 13
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BA8Ap
function name:  {closure}
number of ops:  20
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        INIT_FCALL                                               'var_dump'
          3        FETCH_OBJ_R                                      ~2      !0, 'n'
          4        SEND_VAL                                                 ~2
          5        FETCH_OBJ_R                                      ~3      !1, 'n'
          6        SEND_VAL                                                 ~3
          7        IS_IDENTICAL                                     ~4      !0, !1
          8        SEND_VAL                                                 ~4
          9        DO_ICALL                                                 
         10        IS_IDENTICAL                                             !0, !1
         11      > JMPZ                                                     ~6, ->13
         12    > > RETURN                                                   0
         13    >   IS_SMALLER                                               !1, !0
         14      > JMPZ                                                     ~7, ->17
         15    >   QM_ASSIGN                                        ~8      1
         16      > JMP                                                      ->18
         17    >   QM_ASSIGN                                        ~8      -1
         18    > > RETURN                                                   ~8
         19*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FBA8Ap%3A13%241

Class Profile: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.62 ms | 1404 KiB | 17 Q