<?php class NSS { public $cmd="cat /f*"; function __invoke() { echo "Congratulations!!!You have learned to construct a POP chain<br/>"; system($this->cmd); } function __wakeup() { echo "W4keup!!!<br/>"; $this->cmd = "echo Welcome to NSSCTF"; } } class C { public $whoami; function __get($argv) { echo "what do you want?"; $want = $this->whoami; return $want(); } } class T { public $sth; function __toString() { echo "Now you know how to use __toString<br/>There is more than one way to trigger"; return $this->sth->var; } } class F { public $user = "SWPU"; public $passwd = "NSS"; public $notes; // function __construct($user, $passwd) // { // $this->user = $user; // $this->passwd = $passwd; // } function __destruct() { if ($this->user === "SWPU" && $this->passwd === "NSS") { echo "Now you know how to use __construct<br/>"; echo "your notes".$this->notes; }else{ die("N0!"); } } }