{"id":15026644,"url":"https://github.com/lisachenko/native-php-matrix","last_synced_at":"2025-04-09T20:21:41.779Z","repository":{"id":49142957,"uuid":"227397855","full_name":"lisachenko/native-php-matrix","owner":"lisachenko","description":"PHP Library that provides an implementation of userland types, powered with overloaded operators","archived":false,"fork":false,"pushed_at":"2021-06-27T09:16:14.000Z","size":21,"stargazers_count":44,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-23T22:13:30.803Z","etag":null,"topics":["ffi","operator-overloading","php74","z-engine"],"latest_commit_sha":null,"homepage":null,"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/lisachenko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-11T15:26:29.000Z","updated_at":"2025-01-03T12:31:20.000Z","dependencies_parsed_at":"2022-09-15T12:12:41.069Z","dependency_job_id":null,"html_url":"https://github.com/lisachenko/native-php-matrix","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lisachenko%2Fnative-php-matrix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lisachenko%2Fnative-php-matrix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lisachenko%2Fnative-php-matrix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lisachenko%2Fnative-php-matrix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lisachenko","download_url":"https://codeload.github.com/lisachenko/native-php-matrix/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248104445,"owners_count":21048339,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["ffi","operator-overloading","php74","z-engine"],"created_at":"2024-09-24T20:04:50.122Z","updated_at":"2025-04-09T20:21:41.745Z","avatar_url":"https://github.com/lisachenko.png","language":"PHP","readme":"Native matrix library\n-----------------\n\nFor a long time, PHP developers dreamed of being able to overload operators. And now, finally, this moment has come. \nThanks to the PHP7.4 and the [lisachenko/z-engine](https://github.com/lisachenko/z-engine) package, we can overload the\noperators of comparison, addition, multiplication, casting and much more!\n\nThis library is first ever userland PHP extension, that implements operator overloading for the `Matrix` class.\n\n[![GitHub release](https://img.shields.io/github/release/lisachenko/native-php-matrix.svg)](https://github.com/lisachenko/native-php-matrix/releases/latest)\n[![Minimum PHP Version](http://img.shields.io/badge/php-%3E%3D%207.4-8892BF.svg)](https://php.net/)\n[![License](https://img.shields.io/github/license/lisachenko/native-php-matrix.svg)](https://packagist.org/packages/lisachenko/native-php-matrix)\n[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/lisachenko/native-php-matrix/PHPUnit%20tests)](https://github.com/lisachenko/native-php-matrix/actions/workflows/phpunit.yml)\n\n\nPre-requisites and initialization\n--------------\n\nAs this library depends on `FFI`, it requires PHP\u003e=7.4 and `FFI` extension to be enabled. Also, current limitations of\n[lisachenko/z-engine](https://github.com/lisachenko/z-engine) are also applied (x64, NTS)\n\nTo install this library, simply add it via `composer`:\n```bash\ncomposer require lisachenko/native-php-matrix\n```\n\nNow you can test it with following example:\n\n```php\n\u003c?php\ndeclare(strict_types=1);\n\nuse Lisachenko\\NativePhpMatrix\\Matrix;\n\n$first  = new Matrix([[10, 20, 30]]);\n$second = new Matrix([[2, 4, 6]]);\n$value  = $first * 2 + $second; // Matrix([[22, 44, 66]])\n```\n\nSupported features:\n - [x] Matrices addition (`$matrixA + $matrixB`)\n - [x] Matrices subtraction (`$matrixA - $matrixB`)\n - [x] Matrix multiplication by number (`$matrixA * 2`)\n - [x] Matrices multiplication (`$matrixA * $matrixB`)\n - [x] Dividing a matrix by a number (`$matrixA / 2`)\n - [x] Matrices equality check (`$matrixA == $matrixB`)\n \nFor the future versions, I would like to implement native SSE/AVX assembly methods to improve the performance of calculation.\n\n \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flisachenko%2Fnative-php-matrix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flisachenko%2Fnative-php-matrix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flisachenko%2Fnative-php-matrix/lists"}