Title: Parse error: syntax error, unexpected &#8216;const&#8217;
Last modified: September 12, 2021

---

# Parse error: syntax error, unexpected ‘const’

 *  [andreawpless](https://wordpress.org/support/users/andreawpless/)
 * (@andreawpless)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-const/)
 * My website is based on WordPress and the so-called ‘Hygge’ theme. I did no changes
   to the Website, but the website started to display a parse error: “Parse error:
   syntax error, unexpected ‘const’ (T_CONST), expecting variable (T_VARIABLE) in/
   home/customer/www/tracemaker.com/public_html/wp-content/plugins/wp-less/vendor/
   wikimedia/less.php/lib/Less/Version.php on line 11”
 * I updated Wp less but the situation got worse (i.e., I cannot access to the wp-
   admin login page). I suppose that the Wp less plugin is not compatible with the
   latest WordPress version, or with the current PHP version. How can I solve the
   problem?

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [thom4](https://wordpress.org/support/users/oncletom/)
 * (@oncletom)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-const/#post-14896339)
 * Which version of PHP do you use?
 * I’d suggest you bump it to something more recent, like at least PHP 7.
 *  [pinkish1](https://wordpress.org/support/users/pinkish1/)
 * (@pinkish1)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-const/#post-14897545)
 * [@oncletom](https://wordpress.org/support/users/oncletom/) I have the same error
   as well. I have PHP v7.0.
 * Why does it say that it expects variable instead of const? Is there something
   simple to fix it?
 * The lines in question are in vendor/wikimedia/less.php/lib/Less/Version.php:
 *     ```
       class Less_Version {
       public const version = '3.1.0';
       public const less_version = '2.5.3';
       public const cache_version = '253';
       }
       ```
   
 * Thank you!
 *  Thread Starter [andreawpless](https://wordpress.org/support/users/andreawpless/)
 * (@andreawpless)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-const/#post-14897600)
 * I solved it using PHP 7.4.23. Specifically, It seems that there is a minimum 
   and a MAXIMUM version of PHP to work with, i.e., PHP 8.0.010 (and higher) is 
   the problem. Specifically:
    – with PHP 7.133 the website works – with PHP 7.2.34
   the website works – with PHP 7.3.30 the website works – with PHP 7.4.23 the website
   works – with PHP 8.0.010 “Warning: The magic method Vc_Manager::__wakeup() must
   have public visibility in /home/customer/www/tracemaker.com/public_html/wp-content/
   plugins/js_composer/js_composer.php on line 221”
 *  [pinkish1](https://wordpress.org/support/users/pinkish1/)
 * (@pinkish1)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-const/#post-14897613)
 * I deleted the word “public” from each of the 3 lines and it seems to work on 
   my PHP v7.0.32.
    -  This reply was modified 4 years, 8 months ago by [pinkish1](https://wordpress.org/support/users/pinkish1/).

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Parse error: syntax error, unexpected ‘const’’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-less.svg)
 * [WP-LESS](https://wordpress.org/plugins/wp-less/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-less/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-less/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-less/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-less/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-less/reviews/)

## Tags

 * [Crash](https://wordpress.org/support/topic-tag/crash/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [Unexpected](https://wordpress.org/support/topic-tag/unexpected/)

 * 4 replies
 * 3 participants
 * Last reply from: [pinkish1](https://wordpress.org/support/users/pinkish1/)
 * Last activity: [4 years, 8 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-const/#post-14897613)
 * Status: not resolved