Skip to content

samlitowitz/php-memory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Memory

Table of Contents

  1. Installation
  2. Usage

Installation

composer require samlitowitz/php-memory

Usage

use PhpMemory\MemoryLimit;
use PhpMemory\Unit\Binary\Megabyte;
MemoryLimit::set(Size::create(2, new Megabyte()), true);

echo init_get(MemoryLimit::INI_OPTION);
// 1M
use PhpMemory\MemoryLimit;
use PhpMemory\Unit\Byte;
MemoryLimit::set(Size::create(100, new Byte()));

echo init_get(MemoryLimit::INI_OPTION);
// 100

See MemoryLimitTest for more examples.

About

A library to interact with PHP memory limit

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages