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