expectException(PcreException::class); $this->expectExceptionMessage('PREG_BAD_UTF8_ERROR: Invalid UTF8 character'); preg_replace("/([\s,]+)/u", "foo", "\xc3\x28"); } }