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