1--TEST-- 2GMP operator overloading does not support non-stringable objects 3--EXTENSIONS-- 4gmp 5--FILE-- 6<?php 7 8$num = gmp_init(42); 9$o = new stdClass(); 10 11try { 12 var_dump($num + $o); 13} catch (Throwable $e) { 14 echo $e::class, ': ', $e->getMessage(), PHP_EOL; 15} 16 17try { 18 var_dump($num - $o); 19} catch (Throwable $e) { 20 echo $e::class, ': ', $e->getMessage(), PHP_EOL; 21} 22 23try { 24 var_dump($num * $o); 25} catch (Throwable $e) { 26 echo $e::class, ': ', $e->getMessage(), PHP_EOL; 27} 28 29try { 30 var_dump($num / $o); 31} catch (Throwable $e) { 32 echo $e::class, ': ', $e->getMessage(), PHP_EOL; 33} 34 35try { 36 var_dump($num % $o); 37} catch (Throwable $e) { 38 echo $e::class, ': ', $e->getMessage(), PHP_EOL; 39} 40 41try { 42 var_dump($num ** $o); 43} catch (Throwable $e) { 44 echo $e::class, ': ', $e->getMessage(), PHP_EOL; 45} 46 47try { 48 var_dump($num | $o); 49} catch (Throwable $e) { 50 echo $e::class, ': ', $e->getMessage(), PHP_EOL; 51} 52try { 53 var_dump($num & $o); 54} catch (Throwable $e) { 55 echo $e::class, ': ', $e->getMessage(), PHP_EOL; 56} 57try { 58 var_dump($num ^ $o); 59} catch (Throwable $e) { 60 echo $e::class, ': ', $e->getMessage(), PHP_EOL; 61} 62try { 63 var_dump($num << $o); 64} catch (Throwable $e) { 65 echo $e::class, ': ', $e->getMessage(), PHP_EOL; 66} 67try { 68 var_dump($num >> $o); 69} catch (Throwable $e) { 70 echo $e::class, ': ', $e->getMessage(), PHP_EOL; 71} 72 73?> 74--EXPECT-- 75TypeError: Number must be of type GMP|string|int, stdClass given 76TypeError: Number must be of type GMP|string|int, stdClass given 77TypeError: Number must be of type GMP|string|int, stdClass given 78TypeError: Number must be of type GMP|string|int, stdClass given 79TypeError: Number must be of type GMP|string|int, stdClass given 80TypeError: Unsupported operand types: GMP ** stdClass 81TypeError: Number must be of type GMP|string|int, stdClass given 82TypeError: Number must be of type GMP|string|int, stdClass given 83TypeError: Number must be of type GMP|string|int, stdClass given 84TypeError: Unsupported operand types: GMP << stdClass 85TypeError: Unsupported operand types: GMP >> stdClass 86