Download the PHP package thecrypticace/lazy without Composer

On this page you can find all versions of the php package thecrypticace/lazy. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package lazy

Lazy Collections

Build Status Coverage Status Total Downloads Latest Stable Version License

What

Lazy is a Collection-like wrapper that can operate on iterators one item at a time (on-demand).

Some notes:

  1. Lazy works well for one-shot data sources (e.g. Generators)
  2. Lazy supports algorithms which run with minimal overhead. Functional algorithms are well suited to this.
  3. Lazy collections can convert the underlying data source into an array using ->eager(). Useful for reiterative purposes.
  4. Has convenience methods for simple lazy data generation (e.g. ranges)
  5. Has higher-order collection proxy which will allow code like this: $collection->map->people->map->count()->sum()

Why?

Let's say you have this code:

For a small array $items the work performed here is trivial. If you take a large array containing 1 million numbers starting at one the work performed is large:

Total: 2,000,001 iterations Total: 2,000,001 function calls

Each one of these iterations also incurs the overhead of a function call.

If you replace that call to collect with lazy:

These are the stats:

Since these iterations happen on demand it's not 801 iterations. It's 400 for the entire set. Lazy Collections perform the minimal amount of work needed to get the result.

There are 801 function calls. One for each of the "virtual" iterations in each of the operations. Still, this number is far less than the 2,000,001 calls from the loop above.

Total: 400 iterations Total: 801 function calls

Lazy is effectively performing the same operation as this:

tip: lazy_range(1, 1000000) will generate a Collection with a range from one to one million.


All versions of lazy with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.0
tightenco/collect Version ^5.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package thecrypticace/lazy contains the following files

Loading the files please wait ....