for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
#!/usr/bin/php
<?php
include __DIR__ . '/../vendor/autoload.php';
$filepath = __DIR__ . '/../README.md';
file_put_contents(
$filepath,
preg_replace_callback(
'((```php)(.*?)(```\\s+```\\s+)(.*?)(\\s+```))s',
'patchOutput',
file_get_contents($filepath)
)
);
function patchOutput($m)
{
unset($m[0]);
ob_start();
eval($m[2]);
$m[4] = ob_get_clean();
return implode('', $m);
}