drupal 8

Displaying 1 - 1 of 1

Solving Error: Cannot use * as String because 'String' is a special class name

If you've ever seen an error message in your PHP 7 website about 'String' being a special class name, e.g. Error: Cannot use Drupal\Component\Utility\String as String because 'String' is a special class name in /Users/jesus/drush/commands/core/watchdog.drush.inc, line 4, the reason is that String is now a reserved class name as of PHP 7. So your code that worked fine on PHP 5.7 and earlier will now be broken. This affects Drupal but could affect any old PHP site with a class called String.

This is a problem with Drupal 8 which moved to an OOP-everywhere approach, so...




Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /home/tomo/web/tech.saigonist.com/drupal7/php/includes/common.inc:2776) in drupal_send_headers() (line 1486 of /home/tomo/web/tech.saigonist.com/drupal7/php/includes/bootstrap.inc).
  • Error: Class 'CToolsCssCache' not found in _cache_get_object() (line 32 of /home/tomo/web/tech.saigonist.com/drupal7/php/includes/cache.inc).
The website encountered an unexpected error. Please try again later.