php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51427 Gearman Client AddTaskBackground - The status text is not echoed
Submitted: 2010-03-29 17:27 UTC Modified: 2010-03-29 18:03 UTC
From: james dot smith at cybertill dot co dot uk Assigned: markskilbeck (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: james dot smith at cybertill dot co dot uk
New email:
PHP Version: OS:

 

 [2010-03-29 17:27 UTC] james dot smith at cybertill dot co dot uk
Description:
------------
The worker script function reverse_fn, echo's text in this code segment

# This status loop is not needed, just showing how it works
  for ($x= 0; $x < $workload_size; $x++)
  {
    echo "Sending status: " + $x + 1 . "/$workload_size complete\n";
    $job->sendStatus($x+1, $workload_size);
    $job->sendData(substr($workload, $x, 1));
    sleep(1);
  }

The line 

echo "Sending status: " + $x + 1 . "/$workload_size complete\n";

Should read

echo "Sending status: " . ($x + 1) . "/$workload_size complete\n";

Test script:
---------------
$workload_size = 2;
$x = 0;

echo "Sending status: " + $x + 1 . "/$workload_size complete\n";



Expected result:
----------------
Sending status: 1/2 complete


Actual result:
--------------
1/2 complete


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-03-29 18:03 UTC] markskilbeck@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: markskilbeck
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 11:01:29 2024 UTC