PHP 7.2.0 Release Candidate 2 Released

Voting

Please answer this simple SPAM challenge: min(one, eight)?
(Example: nine)

The Note You're Voting On

julius _email _me _at grantzau _dot _com
7 years ago
To avoid memory problems, when creating a dynamic function within loops, register it as a global variable, and check if it has already been set;

<?php
global $my_func;
if (!isset(
$my_func))
{
   
$my_func = create_function($args, $code);
}

$my_func();
?>

That way you don't end up creating the same function twice (or a couple of million of times, as it happened to me...)

<< Back to user notes page

To Top