Additional Info
Type
Package ID
live627:polyfill-create_functi
First Created
December 01, 2021, 11:26:15 PM
Last Updated
December 08, 2022, 06:41:43 AM

Polyfill of create_function() v1.0.0 Hooks only

Uncover the grave of create_function() because some old mods may still use it.
Compatible With 2.0.18, 2.0.19, 2.1.1
Latest version v1.0.0
Downloads 270
Reviews 0
Rating 0/5
Subscribers 3
License The Unlicense (View License)
Author(s)

Polyfill of create_function()

Uncover the grave of create_function() because some old mods may still use it.

Manual Installation

This is for if you lose access to the package manager due to an error from a missing create_function():

  • Copy Subs-CreateFunction.php into your sources directory
  • Copy install.php to the board directory and execute it (remember to delete it afterwards!)
    • Equivalent to running the following PHP code
      add_integration_function(
      	'integrate_pre_include',
      	'$sourcedir/Subs-CreateFunction.php
      ');
      

But I'm not on PHP 8 yet!

Not to worry. It does nothing if the function is already defined. In fact, here, this is the code.

if (!function_exists('create_function'))
{
	function create_function($args, $code)
	{
		return eval(sprintf('return function(%s) {%s};', $args, $code));
	}
}

Public domain

Do whatever you want with this code. Feed it to alligators for all I care.

polyfill-create_function.zip
3.06 KB v1.0.0 2.1 RC4
Manual installation info
You have to register or login to be able to leave a review
There are currently no reviews on this customization
Advertisement: