Skip to main content

Memory leak in 7.x json_decode()? Best Php Training Trivandrum

Memory leak in 7.x json_decode()?

<?php
echo memory_get_usage(false) . ' : ' .memory_get_usage(true) . PHP_EOL;
$json = json_decode(file_get_contents('http://zaremedia.com/big.json'));
echo memory_get_usage(false) . ' : ' .memory_get_usage(true) . PHP_EOL;
unset($json);
echo memory_get_usage(false) . ' : ' .memory_get_usage(true) . PHP_EOL;
// Running on 7.0 and 7.1
349608 : 2097152
27245512 : 29360128
375552 : 29360128
// Running on 5.6
221136 : 262144
31577064 : 35913728
420104 : 8650752

Comments

  1. I am very glad to read your informative blog...thanks a lot for your valuable sharing
    you can also visit here php training in delhi

    ReplyDelete

Post a Comment

Popular posts from this blog

A DateTimePeriod library for working with temporal intervals php training trivandrum

An implementation of the datetime period type for working with temporal intervals. The library includes the full set of relations on intervals defined by  Allen's Interval Algebra . For further information see the "Usage" and "How it works" paragraphs. Requirements PHP 7.1+ Installation $ composer require pwm/datetime-period Usage Creation: $start = new DateTimeImmutable ( ' 2010-10-10T10:10:10+00:00 ' ); $end = new DateTimeImmutable ( ' 2011-11-11T11:11:11+00:00 ' ); $period = new DateTimePeriod ( $start , $end ); // Start/end instants and their interval $start = $period -> getStart(); // DateTimeImmutable('2010-10-10T10:10:10+00:00') $end = $period -> getEnd(); // DateTimeImmutable('2011-11-11T11:11:11+00:00') $interval = $period -> getInterval(); // DateInterval('P1Y1M1DT1H1M1S') Restrictions: // Throws TimeZoneMismatch exception new DateTimePeriod ( new Da...

New features for personal API Framework Best Php Training Trivandrum

New features for personal API Framework   Hello, I've benn building my own "framework", it's more to a personal bootstrap skeleton project than to a framework. I've been looking for new features for it. I didn't find any http request/response package yet (I'm looking for it too). What could I use to improve my project? Your public/index.php only includes the vendor autoload, how does anything execute? Your code overall makes too much use of  include  and it looks like you wrote your own controller autoloader rather than using PSR. Config files should be configuration data only, they should not include logic. Just my few cents.