PHP code example of typedduck / steins-attributes

1. Go to this page and download the library: Download typedduck/steins-attributes 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/ */

    

typedduck / steins-attributes example snippets


use Steins\Effect;
use Steins\Pure;

#[Pure]
function slugify(string $title): string
{
    return strtolower(trim($title));
}

#[Effect('io.fs.write', 'nondet.time')]
function appendAudit(string $line): void
{
    file_put_contents('/var/log/audit', date('c') . " {$line}\n", FILE_APPEND);
}