1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-06 06:37:33 +02:00

php_shrink: Join echos interleaved with comments

This commit is contained in:
Jakub Vrana
2025-03-15 07:20:12 +01:00
parent 1fd8aa885b
commit 9c1d5484a2
2 changed files with 10 additions and 6 deletions

View File

@@ -13,9 +13,6 @@ function check($code, $expected) {
//! bugs:
check('{if (true) {} echo 1;}', '{if(true);echo 1;}');
//! inefficiencies:
check("echo 1; //\necho 2;", 'echo 1,2;');
check('$ab = 1; echo $ab;', '$a=1;echo$a;');
check('$ab = 1; $cd = 2;', '$a=1;$b=2;');
check('define("AB", 1);', 'define("AB",1);');
@@ -37,6 +34,7 @@ check('if (true) { echo "a"; } else { echo "b"; }', 'if(true)echo"a";else echo"b
check('echo $_GET["a"];', 'echo$_GET["a"];');
check('$ab = 1; echo "$ab";', '$a=1;echo"$a";');
check('echo 1; echo 3;', 'echo 1,3;');
check('echo 1; /**/ echo 2;', 'echo 1,2;');
check('echo 1; ?>2<?php echo 3;', "echo 1,'2',3;");
check('/** preserve */ $a; /** ignore */ /* also ignore */ // ignore too', '/** preserve */$a;');
check('$a = 1; ?><?php ?><?php $a = 2;', '$a=1;$a=2;');