-
-
Notifications
You must be signed in to change notification settings - Fork 342
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Php55] Handle crash on concat variable single quote on PregReplaceEM…
…odifierRector (#2483) Co-authored-by: GitHub Action <action@github.com>
- Loading branch information
1 parent
28ed5cf
commit 6f164da
Showing
4 changed files
with
61 additions
and
12 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
rules-tests/Php55/Rector/FuncCall/PregReplaceEModifierRector/Fixture/concat_variable.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php55\Rector\FuncCall\PregReplaceEModifierRector\Fixture; | ||
|
||
class ConcatVariable | ||
{ | ||
public function run() | ||
{ | ||
$test = 'become : '; | ||
$string ='string'; | ||
echo preg_replace("#([a-z]*)#e", "'".$test."' . strtoupper('\\1')", $string); | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\Php55\Rector\FuncCall\PregReplaceEModifierRector\Fixture; | ||
|
||
class ConcatVariable | ||
{ | ||
public function run() | ||
{ | ||
$test = 'become : '; | ||
$string ='string'; | ||
echo preg_replace_callback('#([a-z]*)#', function ($matches) use ($test) { | ||
return $test . strtoupper($matches[1]); | ||
}, $string); | ||
} | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters