• one day php. alomost all;


    <?
    namespace Test;
    use PhpProjectPhpApp as Other;
    $u=new Other("ns test");
    echo $u->GetUserName();
    echo "annotation: use include, pls include \ which is the common namespace, which need not to be declared as default \";
    echo "<br>";
    echo __NAMESPACE__;
    echo "<br><br><br><br>";
    ?>
    <?
    namespace PhpProject;
    //php注释的写法
    echo "above shows how to create php annotation<br>";
    //php string 连写
    $test="inner string";
    echo "how are ".$test;
    echo "how are:$test<br>";
    global $test;
    //php类的写法
    $GLOBALS["a"]=121;
    echo $GLOBALS["a"]."<br>";
     class PhpApp{
    	function PhpApp($name){
    		$this->self=$name;
            $this::__construct($name);
    	}
        //below is alternate way to construct this class	
    	// function __construct(){	
    	// }
    	public	function GetUserName(){
    		return "how are you ".$this->self;
    	}	
    	public static $Version;
    	private $self;
        var $pty="pty json";
    }
    final class WebApp extends PhpApp{
    	public function GetUserName(){
    		return "webapp".parent::GetUserName();
    	}	
    }
    PhpApp::$Version="1.00";
    $user=new PhpApp("ctor");
    echo $user->GetUserName();
    echo PhpApp::$Version;
    $web=new WebApp("webapp");
    echo $web->GetUserName();
     echo json_encode($user,1);
    var_dump(json_encode($user));
    interface IPhpApp{
        function ruin();
    }
    class MyPhp implements IPhpApp{
        function ruin(){
            echo "ruined";
        }
    }
    $m=new MyPhp();
    $m->ruin();
    
  • 相关阅读:
    FirstBlood溢出攻击
    ShellCode
    OD分析-熊猫烧香
    IDA分析-熊猫烧香
    PentestBOX教程
    安全从业人员常用工具指引-freebuf
    安全从业人员常用工具指引
    Python 网络编程
    10个免费的游戏开发引擎
    用树莓派搭建你自己的Web服务器,以及一个可以外网访问的Blog
  • 原文地址:https://www.cnblogs.com/hualiu0/p/5061519.html
Copyright © 2020-2023  润新知