dm / runtime
PHP-library for disable and override standard functions in real-time
Installs: 22
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 2
Forks: 1
Open Issues: 0
pkg:composer/dm/runtime
Requires
- php: >=5.3.0
This package is not auto-updated.
Last update: 2020-01-20 03:27:10 UTC
README
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();