|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72967 trader_ht_phasor and trader_ht_sine output parameter never modified
Submitted: 2016-08-29 18:30 UTC Modified: 2018-02-11 23:12 UTC
From: joshua dot saige at gmail dot com Assigned:
Status: Duplicate Package: Trader (PECL)
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
 [2016-08-29 18:30 UTC] joshua dot saige at gmail dot com
The functions trader_ht_phasor and trader_ht_sine expect two parameters, the documentation lists one.  The second parameter for both is never populated with the expected data from the C TA-Lib functions.

As noted in Doc Bug #72882, the second required parameter is not listed in the documentation, but is required to execute.

In both cases, the data that should be injected into the second parameter is instead included in the return value.  The return value is a two-dimensional array instead of a single-dimensional array and a modified by-reference parameter, which would be expected given the second parameter is required.

This can be verified at for trader_ht_phasor and for trader_ht_sine.

Using PHP 7.0.8 with Trader 0.4.0 on Windows Server 2012, IIS 8.5.

Test script:
$a1 = [];
$o1 = [];
for($i = 0; $i < 128; $i++){
    $a1[] = rand(1, 100);
$r1 = trader_ht_phasor($a1, $o1);
$r2 = trader_ht_phasor($a1, $a1);
print ($o1 == [] ? 'true' : 'false') . PHP_EOL;
print ($r1 == $r2 ? 'true' : 'false') . PHP_EOL;

//This prints the same when trader_ht_sine replaces trader_ht_phasor.

Expected result:
If the second parameter was being filled, the first print should be 'false'.
If the second parameter was an input parameter (it is not), the second print should be 'false'.  (Consider the second a sanity check.)

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-02-11 23:12 UTC]
-Status: Open +Status: Duplicate
 [2018-02-11 23:12 UTC]
Same as bug #72882.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 15 17:01:32 2024 UTC