- file_put_contents: documentation ( source)
<?php
file_put_contents("/tmp/include-test-A.php", "<?php class A { }");
include("/tmp/include-test-A.php");
$a = new \A();
file_put_contents("/tmp/include-test-B.php", "<?php class B { }");
include("/tmp/include-test-B.php");
$b = new \B();