<?php $hooks = ['before' => [], 'after' => []]; function echoSomething($something) { global $hooks; array_walk($hooks['before'], function($function)use($something) { call_user_func($function, $something); }); echo $something; array_walk($hooks['after'], function($function)use($something) { call_user_func($function, $something); }); } echoSomething('Hello, world'); echo PHP_EOL, '//-------------------------', PHP_EOL; $hooks['before'][] = function() { echo '<b>'; }; $hooks['after'][] = function() { echo '</b>'; }; echoSomething('Hello, world'); echo PHP_EOL, '//-------------------------', PHP_EOL;
You have javascript disabled. You will not be able to edit any code.
Value for `_results` contains invalid data `array`