An open API service indexing awesome lists of open source software.

https://github.com/lisachenko/native-php-matrix

PHP Library that provides an implementation of userland types, powered with overloaded operators
https://github.com/lisachenko/native-php-matrix

ffi operator-overloading php74 z-engine

Last synced: 10 months ago
JSON representation

PHP Library that provides an implementation of userland types, powered with overloaded operators

Awesome Lists containing this project

README

          

Native matrix library
-----------------

For a long time, PHP developers dreamed of being able to overload operators. And now, finally, this moment has come.
Thanks to the PHP7.4 and the [lisachenko/z-engine](https://github.com/lisachenko/z-engine) package, we can overload the
operators of comparison, addition, multiplication, casting and much more!

This library is first ever userland PHP extension, that implements operator overloading for the `Matrix` class.

[![GitHub release](https://img.shields.io/github/release/lisachenko/native-php-matrix.svg)](https://github.com/lisachenko/native-php-matrix/releases/latest)
[![Minimum PHP Version](http://img.shields.io/badge/php-%3E%3D%207.4-8892BF.svg)](https://php.net/)
[![License](https://img.shields.io/github/license/lisachenko/native-php-matrix.svg)](https://packagist.org/packages/lisachenko/native-php-matrix)
[![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)

Pre-requisites and initialization
--------------

As this library depends on `FFI`, it requires PHP>=7.4 and `FFI` extension to be enabled. Also, current limitations of
[lisachenko/z-engine](https://github.com/lisachenko/z-engine) are also applied (x64, NTS)

To install this library, simply add it via `composer`:
```bash
composer require lisachenko/native-php-matrix
```

Now you can test it with following example:

```php