Проблема возникает при введение класса наследника.
<? class Construction{
/* $OneNumber;
$TwoNumber;
$Znak; */
public function itog($OneNumber, $TwoNumber, $Znak){
function dec($h){
$s = array(1=>1, 2=>2, 3=>3, 4=>4, 5=>5, 6=>6, 7=>7, 8=>8, 9=>9,'a'=>10, 'b'=>11, 'c'=>12, 'd'=>13, 'e'=>14, 'f'=>15, 16=>16 );
return $h ? 16*dec(substr($h, 0, -1)) + $s[substr($h, -1)] : 0;
}
function hex($d){
$s = array(1=>1, 2=>2, 3=>3, 4=>4, 5=>5, 6=>6, 7=>7, 8=>8, 9=>9, 10=>'a', 11=>'b', 12=>'c', 13=>'d', 14=>'e', 15=>'f', 16=>16);
return $d ? hex(floor($d/16)).$s[$d%16] : '';
}
$One = dec($OneNumber);
$Two = dec($TwoNumber);
switch($Znak){
case '-': $result = $One - $Two;
case '+': $result = $One + $Two;
};
$finalResult = hex($result);
echo $finalResult;
}
}
?>
class NewConstruction extends Construction{
}
Форма:
<?
$Constr = new Construction;
$Constr->itog($one, $two,$zn);
?>
Наследник:
<?
$ConstrNew = new NewConstruction;
$ConstrNew->itog($one, $two,$zn);
?>