# elementor/3.32.5/modules/atomic-widgets/memo.php

Elementor Website Builder – more than just a page builder, version 3.32.5. 23 lines.

- Page: https://pluginprobe.com/plugins/elementor/3.32.5/code/modules/atomic-widgets/memo.php
- Raw: https://pluginprobe.com/plugins/elementor/3.32.5/raw/modules/atomic-widgets/memo.php
- Modified: 2025-08-05T14:00:00+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/elementor/3.32.5/code/modules/atomic-widgets/memo.php#L10-L20`.

```php
<?php

namespace Elementor\Modules\AtomicWidgets;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

class Memo {
	private array $cache = [];

	public function memoize( string $key, callable $callback ) {
		return function() use ( $key, $callback ) {
			if ( array_key_exists( $key, $this->cache ) ) {
				return $this->cache[ $key ];
			}

			$this->cache[ $key ] = call_user_func( $callback );
			return $this->cache[ $key ];
		};
	}
}

```
