The current standard library exists to implement basic functions, print, require_once, require, include_once, include. in PHPIL, it is enforced that functions that conventionally don't require '(' and ')' such as require etc... must have "function call pattern" i.e
require_once('/path/to/item.php'); // instead of require_once 'path/to/item.php';
The standard library is introduced in https://github.com/hudson1998x/PHPIL/tree/master/Engine/Runtime/Stdlib this directory.
Registering core PHP functions in here is relatively simple:
GlobalRuntimeContext is a partial class, allowing for grouping of function declarations, for example, standard dev functions exist here:
Engine/Runtime/Stdlib/Stdlib.RequireInclude.cs
FunctionTable["print"] = new PhpFunction()
{
Name = "print",
IsSystem = true,
ReturnType = PhpValue.Void,
Action = (params PhpValue[] items) =>
{
foreach (var item in items)
{
Stdout.Write(item.ToStringValue());
}
return PhpValue.Void;
},
IsCompiled = false
};
The PHP standard library is fairly large, so marked this as a good first issue as its a fairly simple endeavour.