PHP Classes

Compatible Version for PHP 5.5 and above

Recommend this page to a friend!

      Financial  >  All threads  >  Compatible Version for PHP 5.5 and above  >  (Un) Subscribe thread alerts  
Subject:Compatible Version for PHP 5.5 and above
Summary:Since this package is no longer maintained I created a new repo
Messages:4
Author:Alan Anderson
Date:2017-03-08 03:59:15
 

  1. Compatible Version for PHP 5.5 and above   Reply   Report abuse  
Picture of Alan Anderson Alan Anderson - 2017-03-08 03:59:15
I created a fork of this repository in my github here: https://github.com/alanmanderson/financial_class

I gave credit to the original author, but Nobody was maintaining it so I copied it. I removed the Yield function which was conflicting with the php 5.5 keyword Yield.

  2. Re: Compatible Version for PHP 5.5 and above   Reply   Report abuse  
Picture of Harry Siereveld Harry Siereveld - 2017-03-25 08:23:00 - In reply to message 1 from Alan Anderson
Alan,

you did well !!
thxz

harry

  3. Re: Compatible Version for PHP 5.5 and above   Reply   Report abuse  
Picture of Harry Siereveld Harry Siereveld - 2018-02-23 18:33:45 - In reply to message 1 from Alan Anderson
Hi Alan,

on line 735 we'll get a ' Division by zero' on include

I suppose the _calculate_fvifa function (which contains "// FIXME: this sucks for very small rates") is responsible.

Any idea how to fix this?

cheers,
harry

  4. Re: Compatible Version for PHP 5.5 and above   Reply   Report abuse  
Picture of Alan Anderson Alan Anderson - 2018-02-26 21:03:14 - In reply to message 3 from Harry Siereveld
I don't have time to review this right now. There should be better error handling. From my initial review it looks like you will get this in the following scenarios:

1. $rate == 0 && $nper == 0
2. $rate * $type == -1
3. (1+$rate) ^ $nper == 1, which can only happen if $rate == 0 which there is a check that prevents you from hitting this code if $rate == 0, so I think it is probably the 1st issue to look into.

Thanks,
Alan

 
For more information send a message to info at phpclasses dot org.