<?php
function calculate($expression) {
$operators = array('+', '-', '*', '=', '/'); $result = 0;
$lastOperator = '+';
$input = '';
foreach ($chars as $char) {
$input .= $char;
switch ($lastOperator) {
case '+':
break;
case '-':
break;
case '*':
break;
case '/':
break;
}
if ($char == '=') {
return $result;
}
$input = '';
$lastOperator = $char;
}
}
}
echo calculate('25.5 + 35.24.25 =');
?>
PD9waHAgCgllcnJvcl9yZXBvcnRpbmcoLTEpOwoJbWJfaW50ZXJuYWxfZW5jb2RpbmcoJ3V0Zi04Jyk7CgkKCWZ1bmN0aW9uIGNhbGN1bGF0ZSgkZXhwcmVzc2lvbikgewoJCSRjaGFycyA9IHByZWdfc3BsaXQoJy8vdScsICRleHByZXNzaW9uKTsKCQkkb3BlcmF0b3JzID0gYXJyYXkoJysnLCAnLScsICcqJywgJz0nLCAnLycpOwoJCSRyZXN1bHQgPSAwOwoJCSRsYXN0T3BlcmF0b3IgPSAnKyc7CgkJJGlucHV0ID0gJyc7CgkJZm9yZWFjaCAoJGNoYXJzIGFzICRjaGFyKSB7CgkJCWlmIChpc19udW1lcmljKCRjaGFyKSBvciAoKCRjaGFyID09ICcuJykgJiYgKG1iX3N1YnN0cl9jb3VudCgkaW5wdXQsICcuJykgPT0gMCkpKSB7CgkJCQkkaW5wdXQgLj0gJGNoYXI7CgkJCX0gZWxzZWlmICAoaW5fYXJyYXkoJGNoYXIsICRvcGVyYXRvcnMpKXsKCQkJCXN3aXRjaCAoJGxhc3RPcGVyYXRvcikgewoJCQkJCWNhc2UgJysnOgoJCQkJCQkkcmVzdWx0ICs9IGZsb2F0dmFsKCRpbnB1dCk7CgkJCQkJCWJyZWFrOwoJCQkJCWNhc2UgJy0nOgoJCQkJCQkkcmVzdWx0IC09IGZsb2F0dmFsKCRpbnB1dCk7CgkJCQkJCWJyZWFrOwoJCQkJCWNhc2UgJyonOgoJCQkJCQkkcmVzdWx0ICo9IGZsb2F0dmFsKCRpbnB1dCk7CgkJCQkJCWJyZWFrOwoJCQkJCWNhc2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