php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #72882 trader_ht_phasor and trader_ht_sine expect two parameters, one listed
Submitted: 2016-08-18 16:19 UTC Modified: 2018-02-11 23:15 UTC
From: joshua dot saige at gmail dot com Assigned: ab (profile)
Status: Closed Package: Trader (PECL)
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: joshua dot saige at gmail dot com
New email:
PHP Version: OS:

 

 [2016-08-18 16:19 UTC] joshua dot saige at gmail dot com
Description:
------------
The functions trader_ht_phasor and trader_ht_sine expect two parameters, the documentation lists one.  The second parameter for both is expected to be a by-reference empty array.

This can be verified at http://svn.php.net/viewvc/pecl/trader/trunk/functions/trader_ht_phasor.c?view=markup line 50 for trader_ht_phasor and http://svn.php.net/viewvc/pecl/trader/trunk/functions/trader_ht_sine.c?view=markup line 50 for trader_ht_sine.

trader_ht_phasor should have the definition of
trader_ht_phasor($real, &$inPhase)

trader_ht_sine should have the definition of
trader_ht_sine($real, &$sine)

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

Test script:
---------------
<?php

trader_ht_phasor([], []);
trader_ht_phasor([]);
trader_ht_sine([], []);
trader_ht_sine([]);


Expected result:
----------------
Lines 4 & 6 will emit a warning.
Lines 3 & 5 will not.

Actual result:
--------------

Warning: trader_ht_phasor() expects exactly 2 parameters, 1 given in test.php on line 4

Warning: trader_ht_sine() expects exactly 2 parameters, 1 given in test.php on line 6


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-02-11 17:17 UTC] ab@php.net
Automatic comment from SVN on behalf of ab
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=344218
Log: Add basic tests for trader_ht_phasor() and trader_ht_sine(), bug #72882 fixed
 [2018-02-11 23:15 UTC] ab@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: ab
 [2018-02-11 23:15 UTC] ab@php.net
Thanks for the report. Finally fixed in 0.4.1. The documentation is correct. The particular two functions only accept one argument. Trader shouldn't accept any by-ref arguments, instead anything relevant is packed into the return. This was the initial approach and any other functions go by it. Thus, fixed in the extension. 

Thanks!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 03 15:01:27 2024 UTC