@ 2016-12-02T02:04:20Z <?php
for(
$c = 0;
$c <= 10;
$c++
){
var_dump(intdiv(PHP_INT_MAX, 10), $c);
var_dump($baz[] = intdiv(PHP_INT_MAX, 10) * $c);
echo "-----------\n";
}
print_r($baz);
/* prints this on my computer:
int(922337203685477580)
int(0)
int(0)
-----------
int(922337203685477580)
int(1)
int(922337203685477580)
-----------
int(922337203685477580)
int(2)
int(1844674407370955160)
-----------
int(922337203685477580)
int(3)
float(2.7670116110564E+18) // WAT?
-----------
int(922337203685477580)
int(4)
int(3689348814741910320)
-----------
int(922337203685477580)
int(5)
int(4611686018427387900)
-----------
int(922337203685477580)
int(6)
float(5.5340232221129E+18) // WAT?
-----------
int(922337203685477580)
int(7)
float(6.4563604257983E+18) // WAT?
-----------
int(922337203685477580)
int(8)
int(7378697629483820640)
-----------
int(922337203685477580)
int(9)
int(8301034833169298220)
-----------
int(922337203685477580)
int(10)
int(9223372036854775800)
-----------
Array
(
[0] => 0
[1] => 922337203685477580
[2] => 1844674407370955160
[3] => 2.7670116110564E+18
[4] => 3689348814741910320
[5] => 4611686018427387900
[6] => 5.5340232221129E+18
[7] => 6.4563604257983E+18
[8] => 7378697629483820640
[9] => 8301034833169298220
[10] => 9223372036854775800
)
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 8.0.0 - 8.0.30 , 8.1.0 - 8.1.28 , 8.2.0 - 8.2.18 , 8.3.0 - 8.3.4 , 8.3.6 Parse error: Unterminated comment starting line 14 in /in/gRuTk on line 14
Process exited with code 255 . Output for 8.3.5 Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Parse error: Unterminated comment starting line 14 in /in/gRuTk on line 14
Process exited with code 255 . Output for 7.0.0 - 7.0.20 , 7.1.0 - 7.1.20 , 7.2.5 - 7.2.33 , 7.3.16 - 7.3.33 , 7.4.0 - 7.4.33 Warning: Unterminated comment starting line 14 in /in/gRuTk on line 14
int(922337203685477580)
int(0)
int(0)
-----------
int(922337203685477580)
int(1)
int(922337203685477580)
-----------
int(922337203685477580)
int(2)
int(1844674407370955160)
-----------
int(922337203685477580)
int(3)
int(2767011611056432740)
-----------
int(922337203685477580)
int(4)
int(3689348814741910320)
-----------
int(922337203685477580)
int(5)
int(4611686018427387900)
-----------
int(922337203685477580)
int(6)
int(5534023222112865480)
-----------
int(922337203685477580)
int(7)
int(6456360425798343060)
-----------
int(922337203685477580)
int(8)
int(7378697629483820640)
-----------
int(922337203685477580)
int(9)
int(8301034833169298220)
-----------
int(922337203685477580)
int(10)
int(9223372036854775800)
-----------
Array
(
[0] => 0
[1] => 922337203685477580
[2] => 1844674407370955160
[3] => 2767011611056432740
[4] => 3689348814741910320
[5] => 4611686018427387900
[6] => 5534023222112865480
[7] => 6456360425798343060
[8] => 7378697629483820640
[9] => 8301034833169298220
[10] => 9223372036854775800
)
Output for 5.6.0 - 5.6.28 Warning: Unterminated comment starting line 14 in /in/gRuTk on line 14
Fatal error: Call to undefined function intdiv() in /in/gRuTk on line 8
Process exited with code 255 . preferences:dark mode live preview
158.01 ms | 401 KiB | 191 Q