How to define global functions in PHP

If you want your function to always be available, without including it, do this: Create your function in a PHP file. In your php.ini file, search for the option auto_prepend_file and add your PHP file to that line, like this: `auto_prepend_file = “/path/to/my_superglobal_function.php”` Or if you write it with a non absolute path, like this: … Read more

Why is the size of a function in C always 1 byte?

It’s a constraint violation, and your compiler should diagnose it. If it compiles it in spite of that, your program has undefined behaviour [thanks to @Steve Jessop for the clarification of the failure mode, and see @Michael Burr’s answer for why some compilers allow this]: From C11, 6.5.3.4./1: The sizeof operator shall not be applied … Read more