3v4l.org

run code in 300+ PHP versions simultaneously
<?php function wp_total_pages( $total_items, $per_page ) { $remainder = $total_items % $per_page; if ( $remainder ) { $total_items += $per_page - $remainder; } return $total_items / $per_page; } $input_sets = [ [506, 10], [505, 10], [504, 10], [500, 9.5], [500, 9], [35478743512, 15], [PHP_INT_MAX, 20], [PHP_INT_MAX + 250, 20], ]; foreach ($input_sets as list($a, $b)) { echo PHP_EOL, '=================================================', PHP_EOL; echo 'Given the following inputs:', PHP_EOL; var_dump($a, $b); $over = $a % $b; $over = ($over > 0) ? 1 : 0; echo PHP_EOL, 'The results will be:', PHP_EOL; echo 'ceil: ', var_dump(ceil($a/$b)); echo 'round + ceil: ', var_dump(round(ceil($a/$b))); echo 'wp_total_pages: ', var_dump(wp_total_pages($a, $b)); try { if (function_exists('intdiv')) { echo 'intdiv: ', var_dump($over + intdiv($a, $b)); } else { echo 'intdiv function not available', PHP_EOL; } } catch (Error $e) { echo 'intdiv: ', $e->getMessage(), PHP_EOL; } try { echo 'bcdiv: ', var_dump($over + bcdiv($a, $b)); } catch (Error $e) { echo 'bcdiv: ', $e->getMessage(), PHP_EOL; } echo PHP_EOL, 'And the results with an int cast added will be:', PHP_EOL; echo 'ceil: ', var_dump((int) ceil($a/$b)); echo 'round + ceil: ', var_dump((int) round(ceil($a/$b))); echo 'wp_total_pages: ', var_dump((int) wp_total_pages($a, $b)); try { if (function_exists('intdiv')) { echo 'intdiv: ', var_dump((int)($over + intdiv($a, $b))); } else { echo 'intdiv function not available', PHP_EOL; } } catch (Error $e) { echo 'intdiv: ', $e->getMessage(), PHP_EOL; } try { echo 'bcdiv: ', var_dump((int) ($over + bcdiv($a, $b))); } catch (Error $e) { echo 'bcdiv: ', $e->getMessage(), PHP_EOL; } }
Output for 8.1.0 - 8.1.31, 8.2.0 - 8.2.27, 8.3.0 - 8.3.15, 8.4.1 - 8.4.2
================================================= Given the following inputs: int(506) int(10) The results will be: ceil: float(51) round + ceil: float(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: int(51) And the results with an int cast added will be: ceil: int(51) round + ceil: int(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: int(51) ================================================= Given the following inputs: int(505) int(10) The results will be: ceil: float(51) round + ceil: float(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: int(51) And the results with an int cast added will be: ceil: int(51) round + ceil: int(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: int(51) ================================================= Given the following inputs: int(504) int(10) The results will be: ceil: float(51) round + ceil: float(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: int(51) And the results with an int cast added will be: ceil: int(51) round + ceil: int(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: int(51) ================================================= Given the following inputs: int(500) float(9.5) Deprecated: Implicit conversion from float 9.5 to int loses precision in /in/V6jdD on line 26 The results will be: ceil: float(53) round + ceil: float(53) wp_total_pages: Deprecated: Implicit conversion from float 9.5 to int loses precision in /in/V6jdD on line 4 float(53.10526315789474) intdiv: Deprecated: Implicit conversion from float 9.5 to int loses precision in /in/V6jdD on line 35 int(56) bcdiv: int(53) And the results with an int cast added will be: ceil: int(53) round + ceil: int(53) wp_total_pages: Deprecated: Implicit conversion from float 9.5 to int loses precision in /in/V6jdD on line 4 int(53) intdiv: Deprecated: Implicit conversion from float 9.5 to int loses precision in /in/V6jdD on line 54 int(56) bcdiv: int(53) ================================================= Given the following inputs: int(500) int(9) The results will be: ceil: float(56) round + ceil: float(56) wp_total_pages: int(56) intdiv: int(56) bcdiv: int(56) And the results with an int cast added will be: ceil: int(56) round + ceil: int(56) wp_total_pages: int(56) intdiv: int(56) bcdiv: int(56) ================================================= Given the following inputs: int(35478743512) int(15) The results will be: ceil: float(2365249568) round + ceil: float(2365249568) wp_total_pages: int(2365249568) intdiv: int(2365249568) bcdiv: int(2365249568) And the results with an int cast added will be: ceil: int(2365249568) round + ceil: int(2365249568) wp_total_pages: int(2365249568) intdiv: int(2365249568) bcdiv: int(2365249568) ================================================= Given the following inputs: int(9223372036854775807) int(20) The results will be: ceil: float(4.611686018427388E+17) round + ceil: float(4.611686018427388E+17) wp_total_pages: float(4.611686018427388E+17) intdiv: int(461168601842738791) bcdiv: int(461168601842738791) And the results with an int cast added will be: ceil: int(461168601842738816) round + ceil: int(461168601842738816) wp_total_pages: int(461168601842738816) intdiv: int(461168601842738791) bcdiv: int(461168601842738791) ================================================= Given the following inputs: float(9.223372036854776E+18) int(20) Deprecated: Implicit conversion from float 9.223372036854776E+18 to int loses precision in /in/V6jdD on line 26 The results will be: ceil: float(4.611686018427388E+17) round + ceil: float(4.611686018427388E+17) wp_total_pages: Deprecated: Implicit conversion from float 9.223372036854776E+18 to int loses precision in /in/V6jdD on line 4 float(4.611686018427388E+17) intdiv: intdiv: intdiv(): Argument #1 ($num1) must be of type int, float given bcdiv: bcdiv: bcdiv(): Argument #1 ($num1) is not well-formed And the results with an int cast added will be: ceil: int(461168601842738816) round + ceil: int(461168601842738816) wp_total_pages: Deprecated: Implicit conversion from float 9.223372036854776E+18 to int loses precision in /in/V6jdD on line 4 int(461168601842738816) intdiv: intdiv: intdiv(): Argument #1 ($num1) must be of type int, float given bcdiv: bcdiv: bcdiv(): Argument #1 ($num1) is not well-formed
Output for 8.0.2 - 8.0.12, 8.0.14 - 8.0.30
================================================= Given the following inputs: int(506) int(10) The results will be: ceil: float(51) round + ceil: float(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: int(51) And the results with an int cast added will be: ceil: int(51) round + ceil: int(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: int(51) ================================================= Given the following inputs: int(505) int(10) The results will be: ceil: float(51) round + ceil: float(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: int(51) And the results with an int cast added will be: ceil: int(51) round + ceil: int(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: int(51) ================================================= Given the following inputs: int(504) int(10) The results will be: ceil: float(51) round + ceil: float(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: int(51) And the results with an int cast added will be: ceil: int(51) round + ceil: int(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: int(51) ================================================= Given the following inputs: int(500) float(9.5) The results will be: ceil: float(53) round + ceil: float(53) wp_total_pages: float(53.10526315789474) intdiv: int(56) bcdiv: int(53) And the results with an int cast added will be: ceil: int(53) round + ceil: int(53) wp_total_pages: int(53) intdiv: int(56) bcdiv: int(53) ================================================= Given the following inputs: int(500) int(9) The results will be: ceil: float(56) round + ceil: float(56) wp_total_pages: int(56) intdiv: int(56) bcdiv: int(56) And the results with an int cast added will be: ceil: int(56) round + ceil: int(56) wp_total_pages: int(56) intdiv: int(56) bcdiv: int(56) ================================================= Given the following inputs: int(35478743512) int(15) The results will be: ceil: float(2365249568) round + ceil: float(2365249568) wp_total_pages: int(2365249568) intdiv: int(2365249568) bcdiv: int(2365249568) And the results with an int cast added will be: ceil: int(2365249568) round + ceil: int(2365249568) wp_total_pages: int(2365249568) intdiv: int(2365249568) bcdiv: int(2365249568) ================================================= Given the following inputs: int(9223372036854775807) int(20) The results will be: ceil: float(4.611686018427388E+17) round + ceil: float(4.611686018427388E+17) wp_total_pages: float(4.611686018427388E+17) intdiv: int(461168601842738791) bcdiv: int(461168601842738791) And the results with an int cast added will be: ceil: int(461168601842738816) round + ceil: int(461168601842738816) wp_total_pages: int(461168601842738816) intdiv: int(461168601842738791) bcdiv: int(461168601842738791) ================================================= Given the following inputs: float(9.223372036854776E+18) int(20) The results will be: ceil: float(4.611686018427388E+17) round + ceil: float(4.611686018427388E+17) wp_total_pages: float(4.611686018427388E+17) intdiv: intdiv: intdiv(): Argument #1 ($num1) must be of type int, float given bcdiv: bcdiv: bcdiv(): Argument #1 ($num1) is not well-formed And the results with an int cast added will be: ceil: int(461168601842738816) round + ceil: int(461168601842738816) wp_total_pages: int(461168601842738816) intdiv: intdiv: intdiv(): Argument #1 ($num1) must be of type int, float given bcdiv: bcdiv: bcdiv(): Argument #1 ($num1) is not well-formed
Output for 8.0.13
================================================= Given the following inputs: int(506) int(10) The results will be: ceil: float(51) round + ceil: float(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: bcdiv: Call to undefined function bcdiv() And the results with an int cast added will be: ceil: int(51) round + ceil: int(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: bcdiv: Call to undefined function bcdiv() ================================================= Given the following inputs: int(505) int(10) The results will be: ceil: float(51) round + ceil: float(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: bcdiv: Call to undefined function bcdiv() And the results with an int cast added will be: ceil: int(51) round + ceil: int(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: bcdiv: Call to undefined function bcdiv() ================================================= Given the following inputs: int(504) int(10) The results will be: ceil: float(51) round + ceil: float(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: bcdiv: Call to undefined function bcdiv() And the results with an int cast added will be: ceil: int(51) round + ceil: int(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: bcdiv: Call to undefined function bcdiv() ================================================= Given the following inputs: int(500) float(9.5) The results will be: ceil: float(53) round + ceil: float(53) wp_total_pages: float(53.10526315789474) intdiv: int(56) bcdiv: bcdiv: Call to undefined function bcdiv() And the results with an int cast added will be: ceil: int(53) round + ceil: int(53) wp_total_pages: int(53) intdiv: int(56) bcdiv: bcdiv: Call to undefined function bcdiv() ================================================= Given the following inputs: int(500) int(9) The results will be: ceil: float(56) round + ceil: float(56) wp_total_pages: int(56) intdiv: int(56) bcdiv: bcdiv: Call to undefined function bcdiv() And the results with an int cast added will be: ceil: int(56) round + ceil: int(56) wp_total_pages: int(56) intdiv: int(56) bcdiv: bcdiv: Call to undefined function bcdiv() ================================================= Given the following inputs: int(35478743512) int(15) The results will be: ceil: float(2365249568) round + ceil: float(2365249568) wp_total_pages: int(2365249568) intdiv: int(2365249568) bcdiv: bcdiv: Call to undefined function bcdiv() And the results with an int cast added will be: ceil: int(2365249568) round + ceil: int(2365249568) wp_total_pages: int(2365249568) intdiv: int(2365249568) bcdiv: bcdiv: Call to undefined function bcdiv() ================================================= Given the following inputs: int(9223372036854775807) int(20) The results will be: ceil: float(4.611686018427388E+17) round + ceil: float(4.611686018427388E+17) wp_total_pages: float(4.611686018427388E+17) intdiv: int(461168601842738791) bcdiv: bcdiv: Call to undefined function bcdiv() And the results with an int cast added will be: ceil: int(461168601842738816) round + ceil: int(461168601842738816) wp_total_pages: int(461168601842738816) intdiv: int(461168601842738791) bcdiv: bcdiv: Call to undefined function bcdiv() ================================================= Given the following inputs: float(9.223372036854776E+18) int(20) The results will be: ceil: float(4.611686018427388E+17) round + ceil: float(4.611686018427388E+17) wp_total_pages: float(4.611686018427388E+17) intdiv: intdiv: intdiv(): Argument #1 ($num1) must be of type int, float given bcdiv: bcdiv: Call to undefined function bcdiv() And the results with an int cast added will be: ceil: int(461168601842738816) round + ceil: int(461168601842738816) wp_total_pages: int(461168601842738816) intdiv: intdiv: intdiv(): Argument #1 ($num1) must be of type int, float given bcdiv: bcdiv: Call to undefined function bcdiv()
Output for 8.0.0 - 8.0.1
================================================= Given the following inputs: int(506) int(10) The results will be: ceil: float(51) round + ceil: float(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: int(51) And the results with an int cast added will be: ceil: int(51) round + ceil: int(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: int(51) ================================================= Given the following inputs: int(505) int(10) The results will be: ceil: float(51) round + ceil: float(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: int(51) And the results with an int cast added will be: ceil: int(51) round + ceil: int(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: int(51) ================================================= Given the following inputs: int(504) int(10) The results will be: ceil: float(51) round + ceil: float(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: int(51) And the results with an int cast added will be: ceil: int(51) round + ceil: int(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: int(51) ================================================= Given the following inputs: int(500) float(9.5) The results will be: ceil: float(53) round + ceil: float(53) wp_total_pages: float(53.10526315789474) intdiv: int(56) bcdiv: int(53) And the results with an int cast added will be: ceil: int(53) round + ceil: int(53) wp_total_pages: int(53) intdiv: int(56) bcdiv: int(53) ================================================= Given the following inputs: int(500) int(9) The results will be: ceil: float(56) round + ceil: float(56) wp_total_pages: int(56) intdiv: int(56) bcdiv: int(56) And the results with an int cast added will be: ceil: int(56) round + ceil: int(56) wp_total_pages: int(56) intdiv: int(56) bcdiv: int(56) ================================================= Given the following inputs: int(35478743512) int(15) The results will be: ceil: float(2365249568) round + ceil: float(2365249568) wp_total_pages: int(2365249568) intdiv: int(2365249568) bcdiv: int(2365249568) And the results with an int cast added will be: ceil: int(2365249568) round + ceil: int(2365249568) wp_total_pages: int(2365249568) intdiv: int(2365249568) bcdiv: int(2365249568) ================================================= Given the following inputs: int(9223372036854775807) int(20) The results will be: ceil: float(4.611686018427388E+17) round + ceil: float(4.611686018427388E+17) wp_total_pages: float(4.611686018427388E+17) intdiv: int(461168601842738791) bcdiv: int(461168601842738791) And the results with an int cast added will be: ceil: int(461168601842738816) round + ceil: int(461168601842738816) wp_total_pages: int(461168601842738816) intdiv: int(461168601842738791) bcdiv: int(461168601842738791) ================================================= Given the following inputs: float(9.223372036854776E+18) int(20) The results will be: ceil: float(4.611686018427388E+17) round + ceil: float(4.611686018427388E+17) wp_total_pages: float(4.611686018427388E+17) intdiv: intdiv: intdiv(): Argument #1 ($num1) must be of type int, float given bcdiv: Warning: bcdiv(): bcmath function argument is not well-formed in /in/V6jdD on line 43 int(0) And the results with an int cast added will be: ceil: int(461168601842738816) round + ceil: int(461168601842738816) wp_total_pages: int(461168601842738816) intdiv: intdiv: intdiv(): Argument #1 ($num1) must be of type int, float given bcdiv: Warning: bcdiv(): bcmath function argument is not well-formed in /in/V6jdD on line 63 int(0)
Output for 7.3.32, 7.4.26, 7.4.33
================================================= Given the following inputs: int(506) int(10) The results will be: ceil: float(51) round + ceil: float(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: bcdiv: Call to undefined function bcdiv() And the results with an int cast added will be: ceil: int(51) round + ceil: int(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: bcdiv: Call to undefined function bcdiv() ================================================= Given the following inputs: int(505) int(10) The results will be: ceil: float(51) round + ceil: float(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: bcdiv: Call to undefined function bcdiv() And the results with an int cast added will be: ceil: int(51) round + ceil: int(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: bcdiv: Call to undefined function bcdiv() ================================================= Given the following inputs: int(504) int(10) The results will be: ceil: float(51) round + ceil: float(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: bcdiv: Call to undefined function bcdiv() And the results with an int cast added will be: ceil: int(51) round + ceil: int(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: bcdiv: Call to undefined function bcdiv() ================================================= Given the following inputs: int(500) float(9.5) The results will be: ceil: float(53) round + ceil: float(53) wp_total_pages: float(53.105263157895) intdiv: int(56) bcdiv: bcdiv: Call to undefined function bcdiv() And the results with an int cast added will be: ceil: int(53) round + ceil: int(53) wp_total_pages: int(53) intdiv: int(56) bcdiv: bcdiv: Call to undefined function bcdiv() ================================================= Given the following inputs: int(500) int(9) The results will be: ceil: float(56) round + ceil: float(56) wp_total_pages: int(56) intdiv: int(56) bcdiv: bcdiv: Call to undefined function bcdiv() And the results with an int cast added will be: ceil: int(56) round + ceil: int(56) wp_total_pages: int(56) intdiv: int(56) bcdiv: bcdiv: Call to undefined function bcdiv() ================================================= Given the following inputs: int(35478743512) int(15) The results will be: ceil: float(2365249568) round + ceil: float(2365249568) wp_total_pages: int(2365249568) intdiv: int(2365249568) bcdiv: bcdiv: Call to undefined function bcdiv() And the results with an int cast added will be: ceil: int(2365249568) round + ceil: int(2365249568) wp_total_pages: int(2365249568) intdiv: int(2365249568) bcdiv: bcdiv: Call to undefined function bcdiv() ================================================= Given the following inputs: int(9223372036854775807) int(20) The results will be: ceil: float(4.6116860184274E+17) round + ceil: float(4.6116860184274E+17) wp_total_pages: float(4.6116860184274E+17) intdiv: int(461168601842738791) bcdiv: bcdiv: Call to undefined function bcdiv() And the results with an int cast added will be: ceil: int(461168601842738816) round + ceil: int(461168601842738816) wp_total_pages: int(461168601842738816) intdiv: int(461168601842738791) bcdiv: bcdiv: Call to undefined function bcdiv() ================================================= Given the following inputs: float(9.2233720368548E+18) int(20) The results will be: ceil: float(4.6116860184274E+17) round + ceil: float(4.6116860184274E+17) wp_total_pages: float(4.6116860184274E+17) intdiv: Warning: intdiv() expects parameter 1 to be int, float given in /in/V6jdD on line 35 int(0) bcdiv: bcdiv: Call to undefined function bcdiv() And the results with an int cast added will be: ceil: int(461168601842738816) round + ceil: int(461168601842738816) wp_total_pages: int(461168601842738816) intdiv: Warning: intdiv() expects parameter 1 to be int, float given in /in/V6jdD on line 54 int(0) bcdiv: bcdiv: Call to undefined function bcdiv()
Output for 7.4.0 - 7.4.25, 7.4.27 - 7.4.32
================================================= Given the following inputs: int(506) int(10) The results will be: ceil: float(51) round + ceil: float(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: int(51) And the results with an int cast added will be: ceil: int(51) round + ceil: int(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: int(51) ================================================= Given the following inputs: int(505) int(10) The results will be: ceil: float(51) round + ceil: float(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: int(51) And the results with an int cast added will be: ceil: int(51) round + ceil: int(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: int(51) ================================================= Given the following inputs: int(504) int(10) The results will be: ceil: float(51) round + ceil: float(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: int(51) And the results with an int cast added will be: ceil: int(51) round + ceil: int(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: int(51) ================================================= Given the following inputs: int(500) float(9.5) The results will be: ceil: float(53) round + ceil: float(53) wp_total_pages: float(53.105263157895) intdiv: int(56) bcdiv: int(53) And the results with an int cast added will be: ceil: int(53) round + ceil: int(53) wp_total_pages: int(53) intdiv: int(56) bcdiv: int(53) ================================================= Given the following inputs: int(500) int(9) The results will be: ceil: float(56) round + ceil: float(56) wp_total_pages: int(56) intdiv: int(56) bcdiv: int(56) And the results with an int cast added will be: ceil: int(56) round + ceil: int(56) wp_total_pages: int(56) intdiv: int(56) bcdiv: int(56) ================================================= Given the following inputs: int(35478743512) int(15) The results will be: ceil: float(2365249568) round + ceil: float(2365249568) wp_total_pages: int(2365249568) intdiv: int(2365249568) bcdiv: int(2365249568) And the results with an int cast added will be: ceil: int(2365249568) round + ceil: int(2365249568) wp_total_pages: int(2365249568) intdiv: int(2365249568) bcdiv: int(2365249568) ================================================= Given the following inputs: int(9223372036854775807) int(20) The results will be: ceil: float(4.6116860184274E+17) round + ceil: float(4.6116860184274E+17) wp_total_pages: float(4.6116860184274E+17) intdiv: int(461168601842738791) bcdiv: int(461168601842738791) And the results with an int cast added will be: ceil: int(461168601842738816) round + ceil: int(461168601842738816) wp_total_pages: int(461168601842738816) intdiv: int(461168601842738791) bcdiv: int(461168601842738791) ================================================= Given the following inputs: float(9.2233720368548E+18) int(20) The results will be: ceil: float(4.6116860184274E+17) round + ceil: float(4.6116860184274E+17) wp_total_pages: float(4.6116860184274E+17) intdiv: Warning: intdiv() expects parameter 1 to be int, float given in /in/V6jdD on line 35 int(0) bcdiv: Warning: bcdiv(): bcmath function argument is not well-formed in /in/V6jdD on line 43 int(0) And the results with an int cast added will be: ceil: int(461168601842738816) round + ceil: int(461168601842738816) wp_total_pages: int(461168601842738816) intdiv: Warning: intdiv() expects parameter 1 to be int, float given in /in/V6jdD on line 54 int(0) bcdiv: Warning: bcdiv(): bcmath function argument is not well-formed in /in/V6jdD on line 63 int(0)
Output for 7.3.0 - 7.3.31, 7.3.33
================================================= Given the following inputs: int(506) int(10) The results will be: ceil: float(51) round + ceil: float(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: int(51) And the results with an int cast added will be: ceil: int(51) round + ceil: int(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: int(51) ================================================= Given the following inputs: int(505) int(10) The results will be: ceil: float(51) round + ceil: float(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: int(51) And the results with an int cast added will be: ceil: int(51) round + ceil: int(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: int(51) ================================================= Given the following inputs: int(504) int(10) The results will be: ceil: float(51) round + ceil: float(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: int(51) And the results with an int cast added will be: ceil: int(51) round + ceil: int(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: int(51) ================================================= Given the following inputs: int(500) float(9.5) The results will be: ceil: float(53) round + ceil: float(53) wp_total_pages: float(53.105263157895) intdiv: int(56) bcdiv: int(53) And the results with an int cast added will be: ceil: int(53) round + ceil: int(53) wp_total_pages: int(53) intdiv: int(56) bcdiv: int(53) ================================================= Given the following inputs: int(500) int(9) The results will be: ceil: float(56) round + ceil: float(56) wp_total_pages: int(56) intdiv: int(56) bcdiv: int(56) And the results with an int cast added will be: ceil: int(56) round + ceil: int(56) wp_total_pages: int(56) intdiv: int(56) bcdiv: int(56) ================================================= Given the following inputs: int(35478743512) int(15) The results will be: ceil: float(2365249568) round + ceil: float(2365249568) wp_total_pages: int(2365249568) intdiv: int(2365249568) bcdiv: int(2365249568) And the results with an int cast added will be: ceil: int(2365249568) round + ceil: int(2365249568) wp_total_pages: int(2365249568) intdiv: int(2365249568) bcdiv: int(2365249568) ================================================= Given the following inputs: int(9223372036854775807) int(20) The results will be: ceil: float(4.6116860184274E+17) round + ceil: float(4.6116860184274E+17) wp_total_pages: float(4.6116860184274E+17) intdiv: int(461168601842738791) bcdiv: int(461168601842738791) And the results with an int cast added will be: ceil: int(461168601842738816) round + ceil: int(461168601842738816) wp_total_pages: int(461168601842738816) intdiv: int(461168601842738791) bcdiv: int(461168601842738791) ================================================= Given the following inputs: float(9.2233720368548E+18) int(20) The results will be: ceil: float(4.6116860184274E+17) round + ceil: float(4.6116860184274E+17) wp_total_pages: float(4.6116860184274E+17) intdiv: Warning: intdiv() expects parameter 1 to be int, float given in /in/V6jdD on line 35 int(0) bcdiv: int(0) And the results with an int cast added will be: ceil: int(461168601842738816) round + ceil: int(461168601842738816) wp_total_pages: int(461168601842738816) intdiv: Warning: intdiv() expects parameter 1 to be int, float given in /in/V6jdD on line 54 int(0) bcdiv: int(0)
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.34
================================================= Given the following inputs: int(506) int(10) The results will be: ceil: float(51) round + ceil: float(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: int(51) And the results with an int cast added will be: ceil: int(51) round + ceil: int(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: int(51) ================================================= Given the following inputs: int(505) int(10) The results will be: ceil: float(51) round + ceil: float(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: int(51) And the results with an int cast added will be: ceil: int(51) round + ceil: int(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: int(51) ================================================= Given the following inputs: int(504) int(10) The results will be: ceil: float(51) round + ceil: float(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: int(51) And the results with an int cast added will be: ceil: int(51) round + ceil: int(51) wp_total_pages: int(51) intdiv: int(51) bcdiv: int(51) ================================================= Given the following inputs: int(500) float(9.5) The results will be: ceil: float(53) round + ceil: float(53) wp_total_pages: float(53.105263157895) intdiv: int(56) bcdiv: int(53) And the results with an int cast added will be: ceil: int(53) round + ceil: int(53) wp_total_pages: int(53) intdiv: int(56) bcdiv: int(53) ================================================= Given the following inputs: int(500) int(9) The results will be: ceil: float(56) round + ceil: float(56) wp_total_pages: int(56) intdiv: int(56) bcdiv: int(56) And the results with an int cast added will be: ceil: int(56) round + ceil: int(56) wp_total_pages: int(56) intdiv: int(56) bcdiv: int(56) ================================================= Given the following inputs: int(35478743512) int(15) The results will be: ceil: float(2365249568) round + ceil: float(2365249568) wp_total_pages: int(2365249568) intdiv: int(2365249568) bcdiv: int(2365249568) And the results with an int cast added will be: ceil: int(2365249568) round + ceil: int(2365249568) wp_total_pages: int(2365249568) intdiv: int(2365249568) bcdiv: int(2365249568) ================================================= Given the following inputs: int(9223372036854775807) int(20) The results will be: ceil: float(4.6116860184274E+17) round + ceil: float(4.6116860184274E+17) wp_total_pages: float(4.6116860184274E+17) intdiv: int(461168601842738791) bcdiv: int(461168601842738791) And the results with an int cast added will be: ceil: int(461168601842738816) round + ceil: int(461168601842738816) wp_total_pages: int(461168601842738816) intdiv: int(461168601842738791) bcdiv: int(461168601842738791) ================================================= Given the following inputs: float(9.2233720368548E+18) int(20) The results will be: ceil: float(4.6116860184274E+17) round + ceil: float(4.6116860184274E+17) wp_total_pages: float(4.6116860184274E+17) intdiv: Warning: intdiv() expects parameter 1 to be integer, float given in /in/V6jdD on line 35 int(0) bcdiv: int(0) And the results with an int cast added will be: ceil: int(461168601842738816) round + ceil: int(461168601842738816) wp_total_pages: int(461168601842738816) intdiv: Warning: intdiv() expects parameter 1 to be integer, float given in /in/V6jdD on line 54 int(0) bcdiv: int(0)
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
================================================= Given the following inputs: int(506) int(10) The results will be: ceil: float(51) round + ceil: float(51) wp_total_pages: int(51) intdiv function not available bcdiv: int(51) And the results with an int cast added will be: ceil: int(51) round + ceil: int(51) wp_total_pages: int(51) intdiv function not available bcdiv: int(51) ================================================= Given the following inputs: int(505) int(10) The results will be: ceil: float(51) round + ceil: float(51) wp_total_pages: int(51) intdiv function not available bcdiv: int(51) And the results with an int cast added will be: ceil: int(51) round + ceil: int(51) wp_total_pages: int(51) intdiv function not available bcdiv: int(51) ================================================= Given the following inputs: int(504) int(10) The results will be: ceil: float(51) round + ceil: float(51) wp_total_pages: int(51) intdiv function not available bcdiv: int(51) And the results with an int cast added will be: ceil: int(51) round + ceil: int(51) wp_total_pages: int(51) intdiv function not available bcdiv: int(51) ================================================= Given the following inputs: int(500) float(9.5) The results will be: ceil: float(53) round + ceil: float(53) wp_total_pages: float(53.105263157895) intdiv function not available bcdiv: int(53) And the results with an int cast added will be: ceil: int(53) round + ceil: int(53) wp_total_pages: int(53) intdiv function not available bcdiv: int(53) ================================================= Given the following inputs: int(500) int(9) The results will be: ceil: float(56) round + ceil: float(56) wp_total_pages: int(56) intdiv function not available bcdiv: int(56) And the results with an int cast added will be: ceil: int(56) round + ceil: int(56) wp_total_pages: int(56) intdiv function not available bcdiv: int(56) ================================================= Given the following inputs: int(35478743512) int(15) The results will be: ceil: float(2365249568) round + ceil: float(2365249568) wp_total_pages: int(2365249568) intdiv function not available bcdiv: int(2365249568) And the results with an int cast added will be: ceil: int(2365249568) round + ceil: int(2365249568) wp_total_pages: int(2365249568) intdiv function not available bcdiv: int(2365249568) ================================================= Given the following inputs: int(9223372036854775807) int(20) The results will be: ceil: float(4.6116860184274E+17) round + ceil: float(4.6116860184274E+17) wp_total_pages: float(4.6116860184274E+17) intdiv function not available bcdiv: int(461168601842738791) And the results with an int cast added will be: ceil: int(461168601842738816) round + ceil: int(461168601842738816) wp_total_pages: int(461168601842738816) intdiv function not available bcdiv: int(461168601842738791) ================================================= Given the following inputs: float(9.2233720368548E+18) int(20) The results will be: ceil: float(4.6116860184274E+17) round + ceil: float(4.6116860184274E+17) wp_total_pages: float(4.6116860184274E+17) intdiv function not available bcdiv: int(0) And the results with an int cast added will be: ceil: int(461168601842738816) round + ceil: int(461168601842738816) wp_total_pages: int(461168601842738816) intdiv function not available bcdiv: int(0)
Output for 5.4.0 - 5.4.45
Parse error: syntax error, unexpected 'list' (T_LIST) in /in/V6jdD on line 22
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/V6jdD on line 11
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/V6jdD on line 11
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/V6jdD on line 11
Process exited with code 255.

preferences:
95.24 ms | 469 KiB | 5 Q