Skip to content

(php) Semicolon inside string parsed as end of statement #4006

Open
@pkaminski

Description

@pkaminski

Describe the issue
It looks like a semicolon inside a string is parsed as terminating the statement, at least sometimes.

Which language seems to have the issue?
php

Are you using highlight or highlightAuto?
highlight

Sample Code to Reproduce
Fiddle here: https://jsfiddle.net/c3sLm2ga/. See how the highlighting gets messed up halfway through the string in the throw statement. Oddly, double-quoted strings are also affected but in a slightly different way.

Expected behavior

public static function mutate() {
  $result = null;
  DB::transaction(function () use (): void {
    if (static::$currentMutator !== null) {
      throw new LoggingMutatorException('LoggingMutator::mutate called while already in a mutation; nested mutations are not supported.');
    }
    $operationLogger = new OperationLogger($user);
  })
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions