4 changed files with 35 additions and 1 deletions
@ -0,0 +1,8 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
function variable_variable_with_array_dim(): void |
||||||
|
{ |
||||||
|
$foo = ['bar' => 'hello']; |
||||||
|
${$foo['bar']} = 'world'; |
||||||
|
echo $hello; |
||||||
|
} |
||||||
@ -0,0 +1,12 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
function variable_name(): string |
||||||
|
{ |
||||||
|
return 'hello'; |
||||||
|
} |
||||||
|
|
||||||
|
function variable_variable_with_function_call(): void |
||||||
|
{ |
||||||
|
${variable_name()} = 'world'; |
||||||
|
echo $hello; |
||||||
|
} |
||||||
@ -0,0 +1,14 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
class VariableVariableTest extends \BaseTest |
||||||
|
{ |
||||||
|
public function testVariableVariableWithArrayDimThrowsUnsupportedError(): void |
||||||
|
{ |
||||||
|
$this->exec('The `$$` syntax is not supported', 'variable-variable-arraydim.php'); |
||||||
|
} |
||||||
|
|
||||||
|
public function testVariableVariableWithFunctionCallThrowsUnsupportedError(): void |
||||||
|
{ |
||||||
|
$this->exec('The `$$` syntax is not supported', 'variable-variable-function-call.php'); |
||||||
|
} |
||||||
|
} |
||||||
Loading…
Reference in new issue