3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Comparator { public static function compareEntities($entityX, $entityY, array $exclusion = []) { if (is_object($entityX) && is_object($entityY)) { return self::checkObjectsEquals($entityX, $entityY, $exclusion); } if (is_array($entityX) && is_array($entityY)) { return self::checkArraysEquals($entityX, $entityY, $exclusion); } return $entityX == $entityY; } public static function checkObjectsEquals($objectX, $objectY, array $exclusion = []) { if (!is_object($objectX) || !is_object($objectY)) { return false; } return self::checkObjectsEqualsByReflection($objectX, $objectY, $exclusion); } public static function checkArraysEquals(array $arrayX, array $arrayY, array $exclusion = []) { return self::checkArraysEqualsByReflection($arrayX, $arrayY, $exclusion); } private static function checkObjectsEqualsByReflection($objectX, $objectY, array $exclusion = [], array &$visitedObjectHashes = []) { if (get_class($objectX) != get_class($objectY)) { return false; } $visitedObjectHashes[] = self::getObjectHash($objectX); $visitedObjectHashes[] = self::getObjectHash($objectY); $reflectionX = new \ReflectionObject($objectX); $reflectionY = new \ReflectionObject($objectY); if (count($reflectionX->getProperties()) != count($reflectionY->getProperties())) { return false; } foreach ($reflectionX->getProperties() as $property) { $property->setAccessible(true); if (!$reflectionY->hasProperty($property->getName())) { return false; } if (!in_array($property->getName(), $exclusion)) { $entityX = $property->getValue($objectX); $entityY = $property->getValue($objectY); if (!($type = self::getPairType($entityX, $entityY))) { return false; } switch ($type) { case 'object' : $alreadyVisited = array_intersect([self::getObjectHash($entityX), self::getObjectHash($entityY)], $visitedObjectHashes); if (!$alreadyVisited && !self::checkObjectsEqualsByReflection($entityX, $entityY, $exclusion, $visitedObjectHashes)) { return false; } break; case 'array' : if (!self::checkArraysEqualsByReflection($entityX, $entityY, $exclusion, $visitedObjectHashes)) { return false; } break; default : if ($entityX != $entityY) { return false; } break; } } } return true; } private static function checkArraysEqualsByReflection(array $arrayX, array $arrayY, array $exclusion = [], array &$visitedObjectHashes = []) { if (count($arrayX) != count($arrayY)) { return false; } $entityY = current($arrayY); foreach ($arrayX as $entityX) { if (!($type = self::getPairType($entityX, $entityY))) { return false; } switch ($type) { case 'object' : $alreadyVisited = array_intersect([self::getObjectHash($entityX), self::getObjectHash($entityY)], $visitedObjectHashes); if (!$alreadyVisited && !self::checkObjectsEqualsByReflection($entityX, $entityY, $exclusion, $visitedObjectHashes)) { return false; } break; case 'array' : if (!self::checkArraysEqualsByReflection($entityX, $entityY, $exclusion, $visitedObjectHashes)) { return false; } break; default : if ($entityX != $entityY) { return false; } break; } $entityY = next($arrayY); } return true; } private static function getObjectHash($object) { return spl_object_hash($object); } private static function getPairType($entityX, $entityY) { if (gettype($entityX) != gettype($entityY)) { return null; } return gettype($entityX); } } class Foo { private $holder; private $children; public function __construct($content = '', array $children = []) { $this->holder = $content; $this->setChildren($children); } public function setChildren(array $children) { $this->children = $children; foreach ($children as $child) { $child->setParent($this); } } } class Bar { private $holder; private $parent; public function __construct($content = '', Foo $parent = null) { $this->holder = $content; $this->setParent($parent); } public function setParent(Foo $parent = null) { $this->parent = $parent; } } $child0 = new Bar('child#0'); $child1 = new Bar('child#1'); //same $child2 = new Bar('child#0'); $child3 = new Bar('child#1'); $parent0 = new Foo('parent', [$child0, $child1]); $parent1 = new Foo('parent', [$child2, $child3]); //Valid: var_dump(Comparator::compareEntities($parent0, $parent1));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UNsj6
function name:  (null)
number of ops:  38
compiled vars:  !0 = $child0, !1 = $child1, !2 = $child2, !3 = $child3, !4 = $parent0, !5 = $parent1
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
  167     0  E >   NEW                                                  $6      'Bar'
          1        SEND_VAL_EX                                                  'child%230'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $6
  168     4        NEW                                                  $9      'Bar'
          5        SEND_VAL_EX                                                  'child%231'
          6        DO_FCALL                                          0          
          7        ASSIGN                                                       !1, $9
  170     8        NEW                                                  $12     'Bar'
          9        SEND_VAL_EX                                                  'child%230'
         10        DO_FCALL                                          0          
         11        ASSIGN                                                       !2, $12
  171    12        NEW                                                  $15     'Bar'
         13        SEND_VAL_EX                                                  'child%231'
         14        DO_FCALL                                          0          
         15        ASSIGN                                                       !3, $15
  173    16        NEW                                                  $18     'Foo'
         17        SEND_VAL_EX                                                  'parent'
         18        INIT_ARRAY                                           ~19     !0
         19        ADD_ARRAY_ELEMENT                                    ~19     !1
         20        SEND_VAL_EX                                                  ~19
         21        DO_FCALL                                          0          
         22        ASSIGN                                                       !4, $18
  174    23        NEW                                                  $22     'Foo'
         24        SEND_VAL_EX                                                  'parent'
         25        INIT_ARRAY                                           ~23     !2
         26        ADD_ARRAY_ELEMENT                                    ~23     !3
         27        SEND_VAL_EX                                                  ~23
         28        DO_FCALL                                          0          
         29        ASSIGN                                                       !5, $22
  177    30        INIT_FCALL                                                   'var_dump'
         31        INIT_STATIC_METHOD_CALL                                      'Comparator', 'compareEntities'
         32        SEND_VAR                                                     !4
         33        SEND_VAR                                                     !5
         34        DO_FCALL                                          0  $26     
         35        SEND_VAR                                                     $26
         36        DO_ICALL                                                     
         37      > RETURN                                                       1

Class Comparator:
Function compareentities:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
2 jumps found. (Code = 46) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 25
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
Branch analysis from position: 7
filename:       /in/UNsj6
function name:  compareEntities
number of ops:  28
compiled vars:  !0 = $entityX, !1 = $entityY, !2 = $exclusion
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        RECV_INIT                                            !2      <array>
    7     3        TYPE_CHECK                                      256  ~3      !0
          4      > JMPZ_EX                                              ~3      ~3, ->7
          5    >   TYPE_CHECK                                      256  ~4      !1
          6        BOOL                                                 ~3      ~4
          7    > > JMPZ                                                         ~3, ->14
    8     8    >   INIT_STATIC_METHOD_CALL                                      'checkObjectsEquals'
          9        SEND_VAR_EX                                                  !0
         10        SEND_VAR_EX                                                  !1
         11        SEND_VAR_EX                                                  !2
         12        DO_FCALL                                          0  $5      
         13      > RETURN                                                       $5
   11    14    >   TYPE_CHECK                                      128  ~6      !0
         15      > JMPZ_EX                                              ~6      ~6, ->18
         16    >   TYPE_CHECK                                      128  ~7      !1
         17        BOOL                                                 ~6      ~7
         18    > > JMPZ                                                         ~6, ->25
   12    19    >   INIT_STATIC_METHOD_CALL                                      'checkArraysEquals'
         20        SEND_VAR_EX                                                  !0
         21        SEND_VAR_EX                                                  !1
         22        SEND_VAR_EX                                                  !2
         23        DO_FCALL                                          0  $8      
         24      > RETURN                                                       $8
   15    25    >   IS_EQUAL                                             ~9      !0, !1
         26      > RETURN                                                       ~9
   16    27*     > RETURN                                                       null

End of function compareentities

Function checkobjectsequals:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 11
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/UNsj6
function name:  checkObjectsEquals
number of ops:  18
compiled vars:  !0 = $objectX, !1 = $objectY, !2 = $exclusion
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   18     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        RECV_INIT                                            !2      <array>
   20     3        TYPE_CHECK                                      256  ~3      !0
          4        BOOL_NOT                                             ~4      ~3
          5      > JMPNZ_EX                                             ~4      ~4, ->9
          6    >   TYPE_CHECK                                      256  ~5      !1
          7        BOOL_NOT                                             ~6      ~5
          8        BOOL                                                 ~4      ~6
          9    > > JMPZ                                                         ~4, ->11
   21    10    > > RETURN                                                       <false>
   24    11    >   INIT_STATIC_METHOD_CALL                                      'checkObjectsEqualsByReflection'
         12        SEND_VAR_EX                                                  !0
         13        SEND_VAR_EX                                                  !1
         14        SEND_VAR_EX                                                  !2
         15        DO_FCALL                                          0  $7      
         16      > RETURN                                                       $7
   25    17*     > RETURN                                                       null

End of function checkobjectsequals

Function checkarraysequals:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UNsj6
function name:  checkArraysEquals
number of ops:  10
compiled vars:  !0 = $arrayX, !1 = $arrayY, !2 = $exclusion
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   27     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        RECV_INIT                                            !2      <array>
   29     3        INIT_STATIC_METHOD_CALL                                      'checkArraysEqualsByReflection'
          4        SEND_VAR_EX                                                  !0
          5        SEND_VAR_EX                                                  !1
          6        SEND_VAR_EX                                                  !2
          7        DO_FCALL                                          0  $3      
          8      > RETURN                                                       $3
   30     9*     > RETURN                                                       null

End of function checkarraysequals

Function checkobjectsequalsbyreflection:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 9
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 36
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 36
2 jumps found. (Code = 77) Position 1 = 39, Position 2 = 124
Branch analysis from position: 39
2 jumps found. (Code = 78) Position 1 = 40, Position 2 = 124
Branch analysis from position: 40
2 jumps found. (Code = 43) Position 1 = 50, Position 2 = 52
Branch analysis from position: 50
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 52
2 jumps found. (Code = 43) Position 1 = 57, Position 2 = 123
Branch analysis from position: 57
2 jumps found. (Code = 43) Position 1 = 72, Position 2 = 74
Branch analysis from position: 72
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 74
4 jumps found. (Code = 188) Position 1 = 80, Position 2 = 107, Position 3 = 118, Position 4 = 75
Branch analysis from position: 80
2 jumps found. (Code = 46) Position 1 = 95, Position 2 = 103
Branch analysis from position: 95
2 jumps found. (Code = 43) Position 1 = 104, Position 2 = 106
Branch analysis from position: 104
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 106
1 jumps found. (Code = 42) Position 1 = 123
Branch analysis from position: 123
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
Branch analysis from position: 103
Branch analysis from position: 107
2 jumps found. (Code = 43) Position 1 = 115, Position 2 = 117
Branch analysis from position: 115
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 117
1 jumps found. (Code = 42) Position 1 = 123
Branch analysis from position: 123
Branch analysis from position: 118
2 jumps found. (Code = 43) Position 1 = 120, Position 2 = 122
Branch analysis from position: 120
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 122
1 jumps found. (Code = 42) Position 1 = 123
Branch analysis from position: 123
Branch analysis from position: 75
2 jumps found. (Code = 44) Position 1 = 77, Position 2 = 80
Branch analysis from position: 77
2 jumps found. (Code = 44) Position 1 = 79, Position 2 = 107
Branch analysis from position: 79
1 jumps found. (Code = 42) Position 1 = 118
Branch analysis from position: 118
Branch analysis from position: 107
Branch analysis from position: 80
Branch analysis from position: 123
Branch analysis from position: 124
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 124
filename:       /in/UNsj6
function name:  checkObjectsEqualsByReflection
number of ops:  127
compiled vars:  !0 = $objectX, !1 = $objectY, !2 = $exclusion, !3 = $visitedObjectHashes, !4 = $reflectionX, !5 = $reflectionY, !6 = $property, !7 = $entityX, !8 = $entityY, !9 = $type, !10 = $alreadyVisited
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   32     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        RECV_INIT                                            !2      <array>
          3        RECV_INIT                                            !3      <array>
   34     4        GET_CLASS                                            ~11     !0
          5        GET_CLASS                                            ~12     !1
          6        IS_NOT_EQUAL                                                 ~11, ~12
          7      > JMPZ                                                         ~13, ->9
   35     8    > > RETURN                                                       <false>
   38     9    >   INIT_STATIC_METHOD_CALL                                      'getObjectHash'
         10        SEND_VAR_EX                                                  !0
         11        DO_FCALL                                          0  $15     
         12        ASSIGN_DIM                                                   !3
         13        OP_DATA                                                      $15
   39    14        INIT_STATIC_METHOD_CALL                                      'getObjectHash'
         15        SEND_VAR_EX                                                  !1
         16        DO_FCALL                                          0  $17     
         17        ASSIGN_DIM                                                   !3
         18        OP_DATA                                                      $17
   40    19        NEW                                                  $18     'ReflectionObject'
         20        SEND_VAR_EX                                                  !0
         21        DO_FCALL                                          0          
         22        ASSIGN                                                       !4, $18
   41    23        NEW                                                  $21     'ReflectionObject'
         24        SEND_VAR_EX                                                  !1
         25        DO_FCALL                                          0          
         26        ASSIGN                                                       !5, $21
   43    27        INIT_METHOD_CALL                                             !4, 'getProperties'
         28        DO_FCALL                                          0  $24     
         29        COUNT                                                ~25     $24
         30        INIT_METHOD_CALL                                             !5, 'getProperties'
         31        DO_FCALL                                          0  $26     
         32        COUNT                                                ~27     $26
         33        IS_NOT_EQUAL                                                 ~25, ~27
         34      > JMPZ                                                         ~28, ->36
   44    35    > > RETURN                                                       <false>
   47    36    >   INIT_METHOD_CALL                                             !4, 'getProperties'
         37        DO_FCALL                                          0  $29     
         38      > FE_RESET_R                                           $30     $29, ->124
         39    > > FE_FETCH_R                                                   $30, !6, ->124
   48    40    >   INIT_METHOD_CALL                                             !6, 'setAccessible'
         41        SEND_VAL_EX                                                  <true>
         42        DO_FCALL                                          0          
   49    43        INIT_METHOD_CALL                                             !5, 'hasProperty'
         44        INIT_METHOD_CALL                                             !6, 'getName'
         45        DO_FCALL                                          0  $32     
         46        SEND_VAR_NO_REF_EX                                           $32
         47        DO_FCALL                                          0  $33     
         48        BOOL_NOT                                             ~34     $33
         49      > JMPZ                                                         ~34, ->52
   50    50    >   FE_FREE                                                      $30
         51      > RETURN                                                       <false>
   52    52    >   INIT_METHOD_CALL                                             !6, 'getName'
         53        DO_FCALL                                          0  $35     
         54        FRAMELESS_ICALL_2                in_array            ~36     $35, !2
         55        BOOL_NOT                                             ~37     ~36
         56      > JMPZ                                                         ~37, ->123
   53    57    >   INIT_METHOD_CALL                                             !6, 'getValue'
         58        SEND_VAR_EX                                                  !0
         59        DO_FCALL                                          0  $38     
         60        ASSIGN                                                       !7, $38
   54    61        INIT_METHOD_CALL                                             !6, 'getValue'
         62        SEND_VAR_EX                                                  !1
         63        DO_FCALL                                          0  $40     
         64        ASSIGN                                                       !8, $40
   55    65        INIT_STATIC_METHOD_CALL                                      'getPairType'
         66        SEND_VAR_EX                                                  !7
         67        SEND_VAR_EX                                                  !8
         68        DO_FCALL                                          0  $42     
         69        ASSIGN                                               ~43     !9, $42
         70        BOOL_NOT                                             ~44     ~43
         71      > JMPZ                                                         ~44, ->74
   56    72    >   FE_FREE                                                      $30
         73      > RETURN                                                       <false>
   58    74    > > SWITCH_STRING                                                !9, [ 'object':->80, 'array':->107, ], ->118
   59    75    >   IS_EQUAL                                                     !9, 'object'
         76      > JMPNZ                                                        ~45, ->80
   65    77    >   IS_EQUAL                                                     !9, 'array'
         78      > JMPNZ                                                        ~45, ->107
         79    > > JMP                                                          ->118
   60    80    >   INIT_FCALL                                                   'array_intersect'
         81        INIT_STATIC_METHOD_CALL                                      'getObjectHash'
         82        SEND_VAR_EX                                                  !7
         83        DO_FCALL                                          0  $46     
         84        INIT_ARRAY                                           ~47     $46
         85        INIT_STATIC_METHOD_CALL                                      'getObjectHash'
         86        SEND_VAR_EX                                                  !8
         87        DO_FCALL                                          0  $48     
         88        ADD_ARRAY_ELEMENT                                    ~47     $48
         89        SEND_VAL                                                     ~47
         90        SEND_VAR                                                     !3
         91        DO_ICALL                                             $49     
         92        ASSIGN                                                       !10, $49
   61    93        BOOL_NOT                                             ~51     !10
         94      > JMPZ_EX                                              ~51     ~51, ->103
         95    >   INIT_STATIC_METHOD_CALL                                      'checkObjectsEqualsByReflection'
         96        SEND_VAR                                                     !7
         97        SEND_VAR                                                     !8
         98        SEND_VAR                                                     !2
         99        SEND_REF                                                     !3
        100        DO_FCALL                                          0  $52     
        101        BOOL_NOT                                             ~53     $52
        102        BOOL                                                 ~51     ~53
        103    > > JMPZ                                                         ~51, ->106
   62   104    >   FE_FREE                                                      $30
        105      > RETURN                                                       <false>
   64   106    > > JMP                                                          ->123
   66   107    >   INIT_STATIC_METHOD_CALL                                      'checkArraysEqualsByReflection'
        108        SEND_VAR_EX                                                  !7
        109        SEND_VAR_EX                                                  !8
        110        SEND_VAR_EX                                                  !2
        111        SEND_VAR_EX                                                  !3
        112        DO_FCALL                                          0  $54     
        113        BOOL_NOT                                             ~55     $54
        114      > JMPZ                                                         ~55, ->117
   67   115    >   FE_FREE                                                      $30
        116      > RETURN                                                       <false>
   69   117    > > JMP                                                          ->123
   71   118    >   IS_NOT_EQUAL                                                 !7, !8
        119      > JMPZ                                                         ~56, ->122
   72   120    >   FE_FREE                                                      $30
        121      > RETURN                                                       <false>
   74   122    > > JMP                                                          ->123
   47   123    > > JMP                                                          ->39
        124    >   FE_FREE                                                      $30
   78   125      > RETURN                                                       <true>
   79   126*     > RETURN                                                       null

End of function checkobjectsequalsbyreflection

Function checkarraysequalsbyreflection:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 9
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 78
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 78
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 24
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
4 jumps found. (Code = 188) Position 1 = 30, Position 2 = 57, Position 3 = 68, Position 4 = 25
Branch analysis from position: 30
2 jumps found. (Code = 46) Position 1 = 45, Position 2 = 53
Branch analysis from position: 45
2 jumps found. (Code = 43) Position 1 = 54, Position 2 = 56
Branch analysis from position: 54
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 56
1 jumps found. (Code = 42) Position 1 = 73
Branch analysis from position: 73
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 53
Branch analysis from position: 57
2 jumps found. (Code = 43) Position 1 = 65, Position 2 = 67
Branch analysis from position: 65
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 67
1 jumps found. (Code = 42) Position 1 = 73
Branch analysis from position: 73
Branch analysis from position: 68
2 jumps found. (Code = 43) Position 1 = 70, Position 2 = 72
Branch analysis from position: 70
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 72
1 jumps found. (Code = 42) Position 1 = 73
Branch analysis from position: 73
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 30
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 57
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 68
Branch analysis from position: 68
Branch analysis from position: 57
Branch analysis from position: 30
Branch analysis from position: 78
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 78
filename:       /in/UNsj6
function name:  checkArraysEqualsByReflection
number of ops:  81
compiled vars:  !0 = $arrayX, !1 = $arrayY, !2 = $exclusion, !3 = $visitedObjectHashes, !4 = $entityY, !5 = $entityX, !6 = $type, !7 = $alreadyVisited
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   81     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        RECV_INIT                                            !2      <array>
          3        RECV_INIT                                            !3      <array>
   83     4        COUNT                                                ~8      !0
          5        COUNT                                                ~9      !1
          6        IS_NOT_EQUAL                                                 ~8, ~9
          7      > JMPZ                                                         ~10, ->9
   84     8    > > RETURN                                                       <false>
   87     9    >   INIT_FCALL                                                   'current'
         10        SEND_VAR                                                     !1
         11        DO_ICALL                                             $11     
         12        ASSIGN                                                       !4, $11
   88    13      > FE_RESET_R                                           $13     !0, ->78
         14    > > FE_FETCH_R                                                   $13, !5, ->78
   89    15    >   INIT_STATIC_METHOD_CALL                                      'getPairType'
         16        SEND_VAR_EX                                                  !5
         17        SEND_VAR_EX                                                  !4
         18        DO_FCALL                                          0  $14     
         19        ASSIGN                                               ~15     !6, $14
         20        BOOL_NOT                                             ~16     ~15
         21      > JMPZ                                                         ~16, ->24
   90    22    >   FE_FREE                                                      $13
         23      > RETURN                                                       <false>
   92    24    > > SWITCH_STRING                                                !6, [ 'object':->30, 'array':->57, ], ->68
   93    25    >   IS_EQUAL                                                     !6, 'object'
         26      > JMPNZ                                                        ~17, ->30
   99    27    >   IS_EQUAL                                                     !6, 'array'
         28      > JMPNZ                                                        ~17, ->57
         29    > > JMP                                                          ->68
   94    30    >   INIT_FCALL                                                   'array_intersect'
         31        INIT_STATIC_METHOD_CALL                                      'getObjectHash'
         32        SEND_VAR_EX                                                  !5
         33        DO_FCALL                                          0  $18     
         34        INIT_ARRAY                                           ~19     $18
         35        INIT_STATIC_METHOD_CALL                                      'getObjectHash'
         36        SEND_VAR_EX                                                  !4
         37        DO_FCALL                                          0  $20     
         38        ADD_ARRAY_ELEMENT                                    ~19     $20
         39        SEND_VAL                                                     ~19
         40        SEND_VAR                                                     !3
         41        DO_ICALL                                             $21     
         42        ASSIGN                                                       !7, $21
   95    43        BOOL_NOT                                             ~23     !7
         44      > JMPZ_EX                                              ~23     ~23, ->53
         45    >   INIT_STATIC_METHOD_CALL                                      'checkObjectsEqualsByReflection'
         46        SEND_VAR                                                     !5
         47        SEND_VAR                                                     !4
         48        SEND_VAR                                                     !2
         49        SEND_REF                                                     !3
         50        DO_FCALL                                          0  $24     
         51        BOOL_NOT                                             ~25     $24
         52        BOOL                                                 ~23     ~25
         53    > > JMPZ                                                         ~23, ->56
   96    54    >   FE_FREE                                                      $13
         55      > RETURN                                                       <false>
   98    

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.82 ms | 2521 KiB | 16 Q