moneyphp/money

PHP implementation of Fowler's Money pattern.

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 10 minutes ago
Type:Library / SDKCategory(s):Core & Utility LibrariesLanguages & Runtimes
Added to GitGenius on September 14th, 2026
Created on March 29th, 2011
Open Issues & Pull Requests: 6 (+0)
GitHub issues: Enabled
Number of forks: 443
Total Stargazers: 4,864 (+0)
Total Subscribers: 92 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 9.1 days
Mean response time: 38.8 days
90th percentile: 136.0 days
Tracked items: 20

Most active contributors

Sign in to see contributor activity.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 1
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 1,123 days
Stale 30+ days: 1
Stale 90+ days: 1

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • resolution/wontfix (1)

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

Money is a PHP library that implements Fowler's Money pattern to represent monetary values safely and accurately.

The problem Money solves is the widespread practice of using floating-point numbers to store currency values, which leads to precision errors and incorrect calculations. The library provides a Money value object that uses strings internally to support unlimited precision arithmetic. It requires the BCMath PHP extension and performs calculations using available big-integer libraries transparently, falling back to plain PHP when necessary.

Developers should adopt this library when building any PHP application that handles monetary transactions or financial calculations. It suits projects ranging from e-commerce platforms to accounting systems where precision is critical. The tool includes built-in support for currency repositories with ISO currencies, money formatting with internationalization support, and currency exchange functionality including integration with the Swap library for real-time exchange rates. JSON serialization is also provided for API responses and data storage.

The project maintains a test-driven development approach using PHPUnit and enforces consistent code style through automated tooling. Contributions are actively welcomed with clear expectations around testing and code quality standards. The library maintains compatibility with actively supported PHP versions while providing older versions for projects on legacy PHP releases.