- basename: documentation ( source)
- file_put_contents: documentation ( source)
<?php
class Foo {
function bar($file) {
include $file;
}
}
$content = '<?php var_dump($this);';
$file = '/tmp/include-test-' . basename(__FILE__);
file_put_contents($file, $content);
Foo::bar($file);