mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_backticks_as_an_alias_for_shell_exec
29 lines
943 B
PHP
29 lines
943 B
PHP
--TEST--
|
|
Bug #64677 (execution operator `` stealing surrounding arguments)
|
|
--FILE--
|
|
<?PHP
|
|
class cat {
|
|
public function show_output($prepend, $output = '') {
|
|
}
|
|
}
|
|
$cat = new cat();
|
|
$cat->show_output('Files: ', trim((string) `cd .`)); // this gives invalid args to shell_exec
|
|
$cat->show_output('Files: ', `cd .`); // this causes a segmentation fault
|
|
$cat->show_output(`cd .`); // this causes a segmentation fault
|
|
|
|
function show_outputa($prepend, $output) {
|
|
echo "Okey";
|
|
}
|
|
show_outputa('Files: ', `cd .`); // this works as expected
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Deprecated: The backtick (`) operator is deprecated, use shell_exec() instead in %s on line %d
|
|
|
|
Deprecated: The backtick (`) operator is deprecated, use shell_exec() instead in %s on line %d
|
|
|
|
Deprecated: The backtick (`) operator is deprecated, use shell_exec() instead in %s on line %d
|
|
|
|
Deprecated: The backtick (`) operator is deprecated, use shell_exec() instead in %s on line %d
|
|
Okey
|