Ad
  • Default User Avatar

    I believe there is something wrong with one of the tests for PHP or with the explanation. According to the example in the explanation every calculation should be resolved from left to right without taking into account the order of operations.

    The following test doesn't seem to agree with this rule:

    $this->assertSame(-4, FluentCalculator::init()->three->dividedBy->six->times->one->zero->plus->three->minus->seven());
    
    3 / 6 = 0.5
    0.5 * 10 = 5
    5 + 3 = 8
    8 - 7 = 1
    

    Following the logic from left to right it results in 1, but the test expects -4. Is the test wrong or am I wrong?

  • Default User Avatar

    I experienced this issue today. Are you sure it's fixed?