Doc #72882 [Opn->Csd]: trader_ht_phasor and trader_ht_sine expect two parameters, one listed
| From: | ab@php.net | Date: | Sun, 11 Feb 2018 23:15:05 +0000 |
| Subject: | Doc #72882 [Opn->Csd]: trader_ht_phasor and trader_ht_sine expect two parameters, one listed | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-15426@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=72882&edit=1
ID: 72882
Updated by: ab@php.net
Reported by: joshua dot saige at gmail dot com
Summary: trader_ht_phasor and trader_ht_sine expect two
parameters, one listed
-Status: Open
+Status: Closed
Type: Documentation Problem
Package: Trader
Operating System: Irrelevant
PHP Version: Irrelevant
-Assigned To:
+Assigned To: ab
Block user comment: N
Private report: N
New Comment:
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!
Previous Comments:
------------------------------------------------------------------------
[2018-02-11 23:12:46] ab@php.net
Related To: Bug #72967
------------------------------------------------------------------------
[2018-02-11 17:17:43] ab@php.net
Automatic comment from SVN on behalf of ab
Revision: http://svn.php.net/viewvc/?view=revision&revision=344218
Log: Add basic tests for trader_ht_phasor() and trader_ht_sine(), bug #72882 fixed
------------------------------------------------------------------------
[2016-08-18 16:19:11] 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
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72882&edit=1