- substr: documentation ( source)
- define: documentation ( source)
- str_contains: documentation ( source)
<?php
hell:
try {
echo PHP;
} catch (\Error $e) {
if (str_contains($e->getMessage(), 'Undefined constant')) {
$constValue = substr($e->getMessage(), 20, -1);
define($constValue, $constValue);
goto hell;
}
}