{"id":34005249,"url":"https://github.com/rodriados/mathr","last_synced_at":"2026-04-07T17:31:00.379Z","repository":{"id":62536786,"uuid":"96721725","full_name":"rodriados/mathr","owner":"rodriados","description":"PHP Package for Mathematical Execution","archived":false,"fork":false,"pushed_at":"2023-02-06T06:25:02.000Z","size":209,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-06T13:27:23.483Z","etag":null,"topics":["calculator","math","parser","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rodriados.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-10T01:08:21.000Z","updated_at":"2022-02-16T16:50:49.000Z","dependencies_parsed_at":"2022-11-02T15:15:40.817Z","dependency_job_id":null,"html_url":"https://github.com/rodriados/mathr","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/rodriados/mathr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodriados%2Fmathr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodriados%2Fmathr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodriados%2Fmathr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodriados%2Fmathr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rodriados","download_url":"https://codeload.github.com/rodriados/mathr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodriados%2Fmathr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31522187,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"ssl_error","status_checked_at":"2026-04-07T16:28:06.951Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["calculator","math","parser","php"],"created_at":"2025-12-13T10:43:37.110Z","updated_at":"2026-04-07T17:31:00.370Z","avatar_url":"https://github.com/rodriados.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mathr\n![license MIT](https://img.shields.io/badge/license-MIT-lightgrey.svg)\n![version 3.0](https://img.shields.io/badge/version-3.0-green.svg)\n[![Build Status](https://travis-ci.org/rodriados/mathr.svg?branch=master)](https://travis-ci.org/rodriados/mathr)\n[![Coverage Status](https://coveralls.io/repos/github/rodriados/mathr/badge.svg?branch=master)](https://coveralls.io/github/rodriados/mathr?branch=master)\n\nMathr is a fast mathematical expression parser, evaluator and calculator with some added juice.\n\n## Usage\n\nThe simplest usage possible for Mathr is by simply sending in a math expression.\n\n```php\n\u003c?php\n$mathr = new Mathr;\n$result = $mathr-\u003eevaluate(\"3 + 4 * 5\");\necho $result; // 23\n```\n\nYou also can create your own variables and functions!\n\n```php\n\u003c?php\n$mathr-\u003eevaluate(\"v = 10\");\n$mathr-\u003eevaluate(\"fibonacci(0) = 0\");\n$mathr-\u003eevaluate(\"fibonacci(1) = 1\");\n$mathr-\u003eevaluate(\"fibonacci(x) = fibonacci(x - 1) + fibonacci(x - 2)\");\n$result = $mathr-\u003eevaluate(\"fibonacci(v)\");\necho $result; // 55\n```\n\nIf you want to, it's possible to bind functions to native PHP closures!\n\n```php\n\u003c?php\n$mathr-\u003eset('triangle(b, h)', fn ($b, $h) =\u003e ($b * $h) / 2);\n$result = $mathr-\u003eevaluate('triangle(5, 8)');\necho $result; // 20\n```\n\nThere are a plenty of native functions and variables which you can use at will.\n\n```php\n\u003c?php\n$mathr-\u003eevaluate(\"fibonacci(x) = ceil((φ ^ x - (1 - φ) ^ x) / sqrt(5))\");\n$result = $mathr-\u003eevaluate(\"fibonacci(10)\");\necho $result; // 55\n```\n\nYou can easily export and import your functions and variables.\n\n```php\n\u003c?php\n$exported = $mathr-\u003eexport(); // Exports all bound functions and variables.\n$mathr-\u003eimport($exported); // Imports functions and variables.\n```\n\n## Install\n\nThe recommended way to install Mathr is via [Composer](http://getcomposer.org).\n\n```json\n{\n    \"require\": {\n        \"rodriados/mathr\": \"v3.0\"\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frodriados%2Fmathr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frodriados%2Fmathr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frodriados%2Fmathr/lists"}