定制 sakanjo/memory-limited 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sakanjo/memory-limited

最新稳定版本:v1.0.0

Composer 安装命令:

composer require sakanjo/memory-limited

包简介

A package to limit the memory upon a function call.

README 文档

README

PHP 8.0

Don't eat my memory please

✨ Help support the maintenance of this package by sponsoring me.

Table of contents

📦 Install

composer require --dev sakanjo/memory-limited

🦄 Usage

use function Sakanjo\MemoryLimited\run_memory_limited;

function memoryEater(): mixed
{
    return memoryEater();
}

run_memory_limited(mb: 20, callback: function() {
    memoryEater(); // It will throw FATAL when reaching 20M of memory, instead of hanging the system
});

Voila, that's it!

Pay attention that this package is only used in development mode for testing purposes, it will throw Fatal error when the memory limit is reached.

💖 Support the development

Do you like this project? Support it by donating

Click the "💖 Sponsor" at the top of this repo.

©️ Credits

📄 License

MIT License © 2023-PRESENT Salah Kanjo

统计信息

  • 总下载量: 6
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-09-20