PHP 7.1 void return type is unknown to Zend Studio

General discussion on Zend Studio

PHP 7.1 void return type is unknown to Zend Studio

Postby stef7535 on Wed May 31, 2017 10:13 am

In the editor I've this fragment of code:
Code: Select all
<?php
class a
{
    public function f(): void
    {
       
    }
}


Zend Studio 13.6 warns me this way:
voidwarn.png
voidwarn.png (8.97 KiB) Viewed 1027 times


hovering the void word I can read in a popup:

"The type void cannot be resolved"

1 quick fix available:
- Inject missing use statement.

Am I missing something about using Zend Studio 13.6 or PHP 7.1 or this is a bug?
stef7535
 
Posts: 2
Joined: Wed May 31, 2017 10:00 am

Re: PHP 7.1 void return type is unknown to Zend Studio

Postby ben45 on Thu Jun 01, 2017 8:10 am

Hm,I think that my brother had similar problem. I don't remember how he solved it, but I think that it could be some kind of a bug, hard to tell. I'll try to reach out to him and then I'll let you know (or maybe the support team will be faster, they are really good:)).
ben45
 
Posts: 1
Joined: Thu Jun 01, 2017 8:03 am

Re: PHP 7.1 void return type is unknown to Zend Studio

Postby mich6938 on Fri Jun 02, 2017 7:27 am

Hi,
The issue comes from extension PDT Extensions. It was most probably installed as a dependency to different plugin e.g. Symfony. To suppress those errors/warnings:
* open Preferences from the main menu
* go to General -> Capabilities and select PDT Extensions element
* close and open Preferences dialog
* go to PHP -> Validation -> Semantic Analysis
* select Enable semantic analysis and press Apply (press Yes when you will be asked to rebuild project)
* deselect Enable semantic analysis and press Apply (press Yes when you will be asked to rebuild project)
* warning should disappear

The workaround is a little bit long but should help. If something won't work let me know. HTH.
mich6938
Zend Product Manager
 
Posts: 352
Joined: Wed Jul 16, 2014 12:32 pm

Re: PHP 7.1 void return type is unknown to Zend Studio

Postby stef7535 on Mon Jun 05, 2017 8:46 am

Good! Your procedure works, but to make the warning disappear I had to restart Zend Studio also to make it work, as last step.

Thank you very much for your help.

Greetings,
Stefano
stef7535
 
Posts: 2
Joined: Wed May 31, 2017 10:00 am


Return to Zend Studio

Who is online

Users browsing this forum: Yahoo [Bot] and 5 guests

cron