mirror of
https://github.com/php/php-src.git
synced 2026-03-27 09:42:22 +01:00
Instead of writing warning messages to `stderr`, we employ PHP's error handling to raise `E_WARNING` even for the single case where `bc_rt_error()` has been called, since that did not actually error out. We choose to call `php_error_docref()` directly in libbcmath, since there is no upstream, and since other PHP core functionality is already used in our bundled libbcmath. Accordingly, we remove `rt.c` so it will not be accidentally used in the future. Besides adapting a few existing tests, we add new tests so that the warnings are tested at least once. We also get rid of the Windows specific tests, since the warning behavior is now supposed to be platform-agnostic.
17 lines
347 B
PHP
17 lines
347 B
PHP
--TEST--
|
|
Bug 72093: bcpowmod accepts negative scale and corrupts _one_ definition
|
|
--SKIPIF--
|
|
<?php
|
|
if(!extension_loaded("bcmath")) print "skip";
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
var_dump(bcpowmod(1, "A", 128, -200));
|
|
var_dump(bcpowmod(1, 1.2, 1, 1));
|
|
?>
|
|
--EXPECTF--
|
|
string(1) "1"
|
|
|
|
Warning: bcpowmod(): non-zero scale in exponent in %s on line %d
|
|
string(3) "0.0"
|