PHP code example of death_satan / macro
1. Go to this page and download the library: Download death_satan/macro 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/ */
death_satan / macro example snippets
class Test{
use \DeathSatan\Macro\Macro;
}
Test::macro('test',function ($a){
return $a;
},true);
Test::macro('demo',function ($a){
return $a;
},false);
var_dump(Test::test(123));//123
var_dump((new Test)->demo(321));//321