1--TEST-- 2GMP operator overloading does support float with no fractional 3--EXTENSIONS-- 4gmp 5--FILE-- 6<?php 7 8$num = gmp_init(42); 9 10try { 11 var_dump($num + 42.0); 12} catch (Throwable $e) { 13 echo $e::class, ': ', $e->getMessage(), PHP_EOL; 14} 15 16try { 17 var_dump($num - 42.0); 18} catch (Throwable $e) { 19 echo $e::class, ': ', $e->getMessage(), PHP_EOL; 20} 21 22try { 23 var_dump($num * 42.0); 24} catch (Throwable $e) { 25 echo $e::class, ': ', $e->getMessage(), PHP_EOL; 26} 27 28try { 29 var_dump($num / 42.0); 30} catch (Throwable $e) { 31 echo $e::class, ': ', $e->getMessage(), PHP_EOL; 32} 33 34try { 35 var_dump($num % 42.0); 36} catch (Throwable $e) { 37 echo $e::class, ': ', $e->getMessage(), PHP_EOL; 38} 39 40try { 41 var_dump($num ** 42.0); 42} catch (Throwable $e) { 43 echo $e::class, ': ', $e->getMessage(), PHP_EOL; 44} 45 46try { 47 var_dump($num | 42.0); 48} catch (Throwable $e) { 49 echo $e::class, ': ', $e->getMessage(), PHP_EOL; 50} 51try { 52 var_dump($num & 42.0); 53} catch (Throwable $e) { 54 echo $e::class, ': ', $e->getMessage(), PHP_EOL; 55} 56try { 57 var_dump($num ^ 42.0); 58} catch (Throwable $e) { 59 echo $e::class, ': ', $e->getMessage(), PHP_EOL; 60} 61try { 62 var_dump($num << 42.0); 63} catch (Throwable $e) { 64 echo $e::class, ': ', $e->getMessage(), PHP_EOL; 65} 66try { 67 var_dump($num >> 42.0); 68} catch (Throwable $e) { 69 echo $e::class, ': ', $e->getMessage(), PHP_EOL; 70} 71 72?> 73--EXPECT-- 74object(GMP)#2 (1) { 75 ["num"]=> 76 string(2) "84" 77} 78object(GMP)#2 (1) { 79 ["num"]=> 80 string(1) "0" 81} 82object(GMP)#2 (1) { 83 ["num"]=> 84 string(4) "1764" 85} 86object(GMP)#2 (1) { 87 ["num"]=> 88 string(1) "1" 89} 90object(GMP)#2 (1) { 91 ["num"]=> 92 string(1) "0" 93} 94object(GMP)#2 (1) { 95 ["num"]=> 96 string(69) "150130937545296572356771972164254457814047970568738777235893533016064" 97} 98object(GMP)#2 (1) { 99 ["num"]=> 100 string(2) "42" 101} 102object(GMP)#2 (1) { 103 ["num"]=> 104 string(2) "42" 105} 106object(GMP)#2 (1) { 107 ["num"]=> 108 string(1) "0" 109} 110object(GMP)#2 (1) { 111 ["num"]=> 112 string(15) "184717953466368" 113} 114object(GMP)#2 (1) { 115 ["num"]=> 116 string(1) "0" 117} 118