Apache / PHP parsers comments
Posted: 03. December 2017 17:21
I have used the following code for a long time. Probably I wrote it as I developed on a Linux computer. Since one and half year I'm using the code with a couple of adjustments on a Windows 10 with PHP 7.
A couple of days ago I received an error
Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in C:\xampp\htdocs\... on line 952
The peculiar is that row 952 is the row that is commented. I have thought about the possibility that the error actually is on another row for, instance because of the comment signs. I have tested without the comment signs, but receives the same message and row number. I have also tried to move the row one step upwards in order to see that actually this row is the one causing the error, and the got the error on row 951, so I can only conclude that PHP or Apache is parsing the commented row. I have used commenting to disable code since more that ten years and have never experienced this before. The version displayed on XAMPP control panel is 3.2.2, but I guess this is not the XAMPP version it self. The XAMPP version should be 5.6.15 or 5.6.21 and l'm not aware of any auto updates, if there is such a thing for XAMPP.
Hope anyone has an idea
- Code: Select all
for($i=0; $i<$cnt; $i++){
$rw=mysqli_fetch_array($rs, MYSQL_ASSOC);
// $ctgid=$rw['CtgId'];
$s='<div ...
A couple of days ago I received an error
Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in C:\xampp\htdocs\... on line 952
The peculiar is that row 952 is the row that is commented. I have thought about the possibility that the error actually is on another row for, instance because of the comment signs. I have tested without the comment signs, but receives the same message and row number. I have also tried to move the row one step upwards in order to see that actually this row is the one causing the error, and the got the error on row 951, so I can only conclude that PHP or Apache is parsing the commented row. I have used commenting to disable code since more that ten years and have never experienced this before. The version displayed on XAMPP control panel is 3.2.2, but I guess this is not the XAMPP version it self. The XAMPP version should be 5.6.15 or 5.6.21 and l'm not aware of any auto updates, if there is such a thing for XAMPP.
Hope anyone has an idea