PHP code example of adlawson / veval

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

    

adlawson / veval example snippets




// Evaluate some code
Veval\execute(<<<'EOF'
class Foo {
    public $name;
    public function __construct($name) {$this->name = $name;}
}
EOF
);

// Use your newly evaulated code
$foo = new Foo('bar');
$foo->name; // bar



// Debug all evaluated strings
Veval\debug(function ($name, $content) {
    // Debug some things here
});

// Iterate over all evaulated strings
foreach (Veval\iterator() as $name => $content) {
    // Debug some things here
}

// Dump all to path
Veval\dump(sys_get_temp_dir(), 'veval-%s.php');