@@ -611,8 +611,17 @@ public function getBitwiseAndType(Expr $left, Expr $right, callable $getTypeCall
611611 return $ this ->getNeverType ($ leftType , $ rightType );
612612 }
613613
614- $ leftTypes = $ leftType ->getConstantScalarTypes ();
615- $ rightTypes = $ rightType ->getConstantScalarTypes ();
614+ if ($ leftType instanceof IntegerRangeType) {
615+ $ leftTypes = $ leftType ->getFiniteTypes ();
616+ } else {
617+ $ leftTypes = $ leftType ->getConstantScalarTypes ();
618+ }
619+ if ($ rightType instanceof IntegerRangeType) {
620+ $ rightTypes = $ rightType ->getFiniteTypes ();
621+ } else {
622+ $ rightTypes = $ rightType ->getConstantScalarTypes ();
623+ }
624+
616625 $ leftTypesCount = count ($ leftTypes );
617626 $ rightTypesCount = count ($ rightTypes );
618627 if ($ leftTypesCount > 0 && $ rightTypesCount > 0 ) {
@@ -680,8 +689,17 @@ public function getBitwiseOrType(Expr $left, Expr $right, callable $getTypeCallb
680689 return $ this ->getNeverType ($ leftType , $ rightType );
681690 }
682691
683- $ leftTypes = $ leftType ->getConstantScalarTypes ();
684- $ rightTypes = $ rightType ->getConstantScalarTypes ();
692+ if ($ leftType instanceof IntegerRangeType) {
693+ $ leftTypes = $ leftType ->getFiniteTypes ();
694+ } else {
695+ $ leftTypes = $ leftType ->getConstantScalarTypes ();
696+ }
697+ if ($ rightType instanceof IntegerRangeType) {
698+ $ rightTypes = $ rightType ->getFiniteTypes ();
699+ } else {
700+ $ rightTypes = $ rightType ->getConstantScalarTypes ();
701+ }
702+
685703 $ leftTypesCount = count ($ leftTypes );
686704 $ rightTypesCount = count ($ rightTypes );
687705 if ($ leftTypesCount > 0 && $ rightTypesCount > 0 ) {
@@ -739,8 +757,17 @@ public function getBitwiseXorType(Expr $left, Expr $right, callable $getTypeCall
739757 return $ this ->getNeverType ($ leftType , $ rightType );
740758 }
741759
742- $ leftTypes = $ leftType ->getConstantScalarTypes ();
743- $ rightTypes = $ rightType ->getConstantScalarTypes ();
760+ if ($ leftType instanceof IntegerRangeType) {
761+ $ leftTypes = $ leftType ->getFiniteTypes ();
762+ } else {
763+ $ leftTypes = $ leftType ->getConstantScalarTypes ();
764+ }
765+ if ($ rightType instanceof IntegerRangeType) {
766+ $ rightTypes = $ rightType ->getFiniteTypes ();
767+ } else {
768+ $ rightTypes = $ rightType ->getConstantScalarTypes ();
769+ }
770+
744771 $ leftTypesCount = count ($ leftTypes );
745772 $ rightTypesCount = count ($ rightTypes );
746773 if ($ leftTypesCount > 0 && $ rightTypesCount > 0 ) {
0 commit comments