Skip to content

Commit f63fdb5

Browse files
committed
add fixture with variable
1 parent c00a787 commit f63fdb5

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
3+
namespace Rector\Tests\Php85\Rector\ShellExec\ShellExecFunctionCallOverBackticksRector\Fixture;
4+
5+
class WithVariable
6+
{
7+
public function run()
8+
{
9+
$dir = __DIR__;
10+
$var = 'example';
11+
12+
$output = `ls -al`;
13+
$output2 = `ls $dir`;
14+
$output3 = `echo "value: $var"`;
15+
echo "<pre>$output</pre>";
16+
echo "<pre>$output2</pre>";
17+
echo "<pre>$output3</pre>";
18+
}
19+
}
20+
21+
?>
22+
-----
23+
<?php
24+
25+
namespace Rector\Tests\Php85\Rector\ShellExec\ShellExecFunctionCallOverBackticksRector\Fixture;
26+
27+
class WithVariable
28+
{
29+
public function run()
30+
{
31+
$dir = __DIR__;
32+
$var = 'example';
33+
34+
$output = shell_exec("ls -al");
35+
$output2 = shell_exec("ls $dir");
36+
$output3 = shell_exec("echo \"value: $var\"");
37+
echo "<pre>$output</pre>";
38+
echo "<pre>$output2</pre>";
39+
echo "<pre>$output3</pre>";
40+
}
41+
}
42+
43+
?>

0 commit comments

Comments
 (0)