PHP 8.6 support and deprecated calling is_a() with a string when $allow_string is false

Hi team,

I just switched my local dev site to PHP 8.6 and every frontend page now starts with hundreds of lines like this, right in the HTML:

E_DEPRECATED: Calling is_a() with a string when $allow_string is false in.../cornerstone/includes/classes/Tss/Evaluator.php on line 37.

Setup: Pro 6.9.8 / Cornerstone 7.9.8, WordPress 7.1.5, PHP 8.6.0, WP_DEBUG on, WP_DEBUG_DISPLAY off.

There are two separate things going on:

  1. is_a() with a non-object. PHP 8.6 deprecates calling is_a() on a string (or anything that isn’t an object) unless $allow_string is true. It used to just return false silently. The TSS code does this for every CSS value:
  • Tss/Evaluator.php lines 37, 41, 104
  • Tss/Typed/Typed.php line 24
  • Tss/Functions/BuiltInFunction.php line 40Replacing is_a( $x, Foo::class ) with $x instanceof Foo fixes it and behaves exactly the same. There are about 137 is_a() calls in Cornerstone overall, so a search across the codebase is probably worth it.
  1. The ErrorHandler echoes errors into the output. Util/ErrorHandler.php catches everything during Styling::postProcess() , and flush() then echoes it straight into the page, ignoring display_errors / WP_DEBUG_DISPLAY . That’s why the notices end up in the HTML instead of the log, and it also causes “headers already sent” warnings (pluggable.php , WooCommerce AJAX). Ideally caught errors would go to error_log() and only be shown when display_errors is on.Small extra: line 79 uses E_STRICT , which is itself deprecated since PHP 8.4.

Live sites without WP_DEBUG aren’t affected (WordPress leaves E_DEPRECATED out of error_reporting there), but anyone developing with debug mode on PHP 8.6 will hit this right away.

Thanks in advance!