Skip to content

Commit 78ca985

Browse files
committed
fix var name location
1 parent 4c87f29 commit 78ca985

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/parser/variable.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
44
* @url http://glayzzle.com
55
*/
6+
"use strict";
67
module.exports = {
78
/**
89
* Reads a variable
@@ -232,8 +233,9 @@ module.exports = {
232233
var result = this.node('variable');
233234
if (this.expect([this.tok.T_VARIABLE, '$']) && this.token === this.tok.T_VARIABLE) {
234235
// plain variable name
235-
result = result(this.text(), byref);
236+
var name = this.text();
236237
this.next();
238+
result = result(name, byref);
237239
} else {
238240
if (this.token === '$') this.next();
239241
// dynamic variable name

0 commit comments

Comments
 (0)