Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class TextClass{
- function __construct(){
- $file_contents = file_get_contents("file.txt");
- print $file_contents;
- }
- }
- class HelperClass{
- public $file = "file.txt";
- function load_data($data){
- file_put_contents($this->file, $data);
- }
- }
- class MainClass{
- public $obj;
- public $data;
- function __construct($data) {
- $this->data = $data;
- }
- function __wakeup(){
- if(isset($this->obj)){
- $this->obj->load_data($this->data);
- }
- }
- $o = new MainClass("");
- echo serialize($o);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement