Debugging on MacOS, declare strict and non-ascii chars

General discussion forum for the Zend Server

Debugging on MacOS, declare strict and non-ascii chars

Postby larsribe on Tue Jan 02, 2018 9:12 am

Hi Zend
System setup: MacOS High Sierra running Zend Server 9.1.2.

If I make a file containing non-ASCII chars, e.g.

TestClass.php:
<?php
declare(strict_types=1);

class TestClass
{
public function test()
{
echo 'ÆØÅ'; //Danish characters
}
}

Then I can call the class from the web server without problems, I can run a unit test without a problem, but if I debug the class through the web server or through unit testing, I get an error:

TestClass.php line 2: strict_types declaration must be the very first statement in the script

I have tried with and without an autoloader so that seems not like being the problem. I have also tried to save the file as UTF-8 or ISO-8859-1 without any difference, so it is apparently not the UTF8 BOM.

This occurs both with Zend Studio and PHP Storm, so the problem must be the debugger.
larsribe
 
Posts: 9
Joined: Wed Sep 02, 2009 3:53 pm

Re: Debugging on MacOS, declare strict and non-ascii chars

Postby zvika on Sun Jan 07, 2018 2:16 pm

Hello Lars,
thank you for bringing this to our attention.
Please report the issue through the support portal,
as suggested on your post viewtopic.php?f=8&t=133893
Thank you.
Zvika Dror
Zend Support Team
User avatar
zvika
Zend Global Support
 
Posts: 991
Joined: Sun Dec 14, 2008 9:48 am

Re: Debugging on MacOS, declare strict and non-ascii chars

Postby zvika on Sun Jan 07, 2018 2:28 pm

Hi Lars,
Can you verify that your PHPUnit is above 6.4.1?
I found an issue which was fixed by Sebastian Bergmann here:
https://github.com/sebastianbergmann/ph ... ssues/2791

If upgrading PHPUnit doesn't help, please proceed as recommended earlier by opening a support case so we can work on the issue in the official channels.
Zvika Dror
Zend Support Team
User avatar
zvika
Zend Global Support
 
Posts: 991
Joined: Sun Dec 14, 2008 9:48 am


Return to Zend Server

Who is online

Users browsing this forum: Google [Bot] and 3 guests