phpseclib/bcmath_compat 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

phpseclib/bcmath_compat

最新稳定版本:2.0.3

Composer 安装命令:

composer require phpseclib/bcmath_compat

包简介

PHP 5.x-8.x polyfill for bcmath extension

README 文档

README

Software License CI Status

PHP 5.x-8.x polyfill for bcmath extension

Installation

With Composer:

$ composer require phpseclib/bcmath_compat

Limitations

  • extension_loaded('bcmath')

    bcmath_compat cannot make this return true. The recommended remediation is to not do this.

  • ini_set('bcmath.scale', ...)

    You cannot set configuration options for extensions that are not installed. If you do ini_set('bcmath.scale', 5) on a system without bcmath installed then ini_get('bcmath.scale') will return false. It's similar to what happens when you do ini_set('zzz', 5) and then ini_get('zzz'). You'll get false back.

    The recommended remediation to doing ini_set('bcmath.scale', ...) is to do bcscale(...). The recommended remediation for doing ini_get is (if you're using PHP >= 7.3.0) to do bcscale() or (if you're using PHP < 7.3.0) to do max(0, strlen(bcadd('0', '0')) - 2).

    Note that ini_get always returns a string whereas the recommended remediations return integers.

统计信息

  • 总下载量: 20.11M
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 167
  • 点击次数: 3
  • 依赖项目数: 12
  • 推荐数: 6

GitHub 信息

  • Stars: 166
  • Watchers: 1
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04