- shell_exec: documentation ( source)
- trim: documentation ( source)
<?PHP
class cat {
public function show_output($prepend, $output = '') {echo $prepend . $output;}
public function show_out($output) {echo $output;}
}
$cat = new cat();
$cat->show_output('Files: ', trim(`ls`)); // this gives invalid args to shell_exec
$cat->show_output('Files: ', `ls`); // this causes a segmentation fault
$cat->show_out(`ls`); // this causes a segmentation fault
function show_outputa($prepend, $output) {echo $prepend . $output;}
show_outputa('Files: ', `ls`); // this works as expected