This example executes a dynamically selected eval fragment that calls
preg_match(). Because the regex call is opaque to AOT feature detection, the
project declares managed PCRE2 and compilation explicitly enables the runtime
capability.
From this directory:
elephc native add pcre2
elephc --with-regex main.php
./mainThe expected output is:
1:id:42
Without --with-regex, the program still compiles, but regex functions are not
exposed to dynamic eval and a call to preg_match() fails at runtime.