Skip to content
This repository has been archived by the owner on Feb 15, 2018. It is now read-only.

dmkuznetsov/php-runtime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Runtime

Now, you can disable and override standard functions in real-time.

<?php
$code = <<<CODE
<?php
echo str_replace( 0, 1, 100 );
?>
CODE;

// thrown exception, becouse str_replace disabled
Dm\Runtime\Api::code($code)
    ->disableFunction('str_replace')
    ->execute();
<?php
$code = <<<CODE
<?php
echo str_replace( 0, 1, 100 );
?>
CODE;

// output 111
echo str_replace( 0, 1, 100 );

// output 000
Dm\Runtime\Api::code($code)
    ->overrideFunction('str_replace', function ($search, $replace, $subject) {
        echo str_replace($replace, $search, $subject);
    })
    ->execute();

About

Disable and override standard functions in real-time

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages