Unexpected token '' -- PHP Tools v1.22.9523.2015

PHP Tools [?] extends Visual Studio with set of advanced features to work more efficiently with PHP code.

Unexpected token '' -- PHP Tools v1.22.9523.2015

Postby Blitzstromunger » February 22nd, 2017, 6:13 pm

Severity Code Description Project File Line Column Suppression State
Error Syntax error: unexpected token '' RWB forms_select.php 9 1

<?php
if (session_status() == PHP_SESSION_NONE) {
session_start();
}

if(isset($_POST['scan_CT_contrast_consent'])){
$_SESSION['CT_contrast_consent'] = true;
$_POST['currentPage'] = 'CT_contrast_consent';
}else{
if(isset($_SESSION['CT_contrast_consent'])){
unset($_SESSION['CT_contrast_consent']);
}
}
?>

Error is on "}else{" line column 1.
Blitzstromunger
 
Posts: 3
Joined: February 22nd, 2017, 5:46 pm

Re: Unexpected token '' -- PHP Tools v1.22.9523.2015

Postby Blitzstromunger » February 22nd, 2017, 6:17 pm

It appears this only occurs when the page also contains nested html and if statements, like:


<?php
if(true){
?>
<html>
<?php
if (false){
?>
</html>
<?php
}
}
?>
Blitzstromunger
 
Posts: 3
Joined: February 22nd, 2017, 5:46 pm

Re: Unexpected token '' -- PHP Tools v1.22.9523.2015

Postby Blitzstromunger » February 22nd, 2017, 6:34 pm

Please mostly ignore this post, it was a dangling curly bracket causing the issue. It would be nice if it tracked the line number a little better, it appears to only count lines of php code, not html.
Blitzstromunger
 
Posts: 3
Joined: February 22nd, 2017, 5:46 pm


Return to PHP Tools

Who is online

Users browsing this forum: No registered users and 47 guests

cron

User Control Panel

Login

Who is online

In total there are 47 users online :: 0 registered, 0 hidden and 47 guests (based on users active over the past 5 minutes)
Most users ever online was 256 on March 28th, 2024, 9:42 am

Users browsing this forum: No registered users and 47 guests