Skip to content

Instantly share code, notes, and snippets.

View naczu's full-sized avatar
😶

Oğuz Can SERTEL naczu

😶
View GitHub Profile
@naczu
naczu / test-memory-limit.php
Created November 10, 2019 22:49 — forked from thonixx/test-memory-limit.php
Test PHPs memory limit
<pre>
<?php
$megabyte = 1528; // define the max megabytes which should be tested
function tryAlloc($megabyte){
echo "try allocating {$megabyte} megabyte...";
$mb = $megabyte;
$dummy = str_repeat("-",1048576*$mb);
echo "pass.";
echo "Usage: " . memory_get_usage(true)/1048576;