<?php
//php重载和重写
class base{
function out()
{
echo 'base print';
}
}
class a extends base{
function out()
{
echo 'a print';
}
}
$a = new a();
$a->out();
class p
{
function get()
{
$arg = func_get_args();
$count = count($arg);
if($count == 1)
{
echo $arg[0];
}else if($count == 2)
{
echo $arg[0].$arg[1];
}
}
}
$p = new p();
$p->get('one');
$p->get('two',3939393);
exit();