What am I doing wrong?

I am getting errors when using the script from this page. https://github.com/andy-sen/php-bond-yield

This is what is given as an example on the website, but does not work for me.

<?phprequire_once 'bondyield.php';printf("%f\n",BondYield::Calculate('2001-12-16',99, '2002-01-15',5,2,100));

I get 6 errors like this:

Strict Standards: Non-static method BondYield::getDateParams() should not be called statically in public_html/00_test/bondyield.php on line 93


share|improve this question
  • because Calculate is not static function– Ganesh KanduFeb 13 at 17:17

check this

<?phprequire_once 'bondyield.php';$obj=new BondYield();printf("%f\n",$obj->Calculate('2001-12-16',99, '2002-01-15',5,2,100));
share|improve this answer
  • Ahhh! that did it. thx.– user2299779Feb 14 at 5:05
  • Also, if you want to assign it to a variable use $x=sprintf("%f\n",BondYie...– user2299779Feb 14 at 5:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.