danack/looping-exec

A function for running code in a loop.

Maintainers

👁 Danack

Package info

github.com/Danack/LoopingExec

pkg:composer/danack/looping-exec

Fund package maintenance!

Danack

Statistics

Installs: 386

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

0.3.0 2021-03-03 17:59 UTC

Requires

  • ext-pcntl: *

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT ffcb149d41f71fb23b2db016588c835567fe6d1d

  • Danack <Danack.woop@basereality.com>

This package is auto-updated.

Last update: 2026-06-29 01:50:34 UTC


README

A function library to allow repeatedly running a callable for a certain amount of time before returning.

Please note, parameters are open to change.

Example

<?php

require __DIR__ . "/vendor/autoload.php";

use function LoopingExec\continuallyExecuteCallable;

$fn = function () {
 static $count = 0;
 echo "Hello world: $count\n";
 $count += 1;
};

continuallyExecuteCallable(
 $fn,
 5,
 1000,
 0
);

// output is:
// Hello world: 0
// Hello world: 1
// Hello world: 2
// Hello world: 3
// Hello world: 4