PHP code example of felixdorn / sey

1. Go to this page and download the library: Download felixdorn/sey library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

felixdorn / sey example snippets


Sey::parse('(0.5 + 0.5) / 3)'); // 0.3333333333333333
// or
sey('a / b', ['a' => 1, 'b' => 2]); // 0.5

\Felix\Sey\Sey:precision(32);

Sey::parse('2 * r * pi', [
    'r' => 10,
    'pi' => 3.1415
]);

Sey::define('!', function (int $n, /* as many arguments as you want */) {
    return $factorials[$n] ?? bcfact($n);
});