实例
<?php namespace one; use one\two\Test as Test1; class Test{public $name = '小明';} const SEX = '男'; function study($program = 'PHP'){return $program;} echo (new Test)->name.'是'.SEX.'学习'.study(); echo '<hr>'; echo (new Test1)->name.'是'.(new Test1)->sex.'学习'.(new Test1)->study; namespace one\two; class Test { public $name = '小红'; public $sex = '女'; public $study = 'JAVA'; }
运行实例 »
点击 "运行实例" 按钮查看在线实例
测试效果图: