Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: abstract function type default value #1667

Closed
hellobbq opened this issue Aug 23, 2018 · 5 comments
Closed

error: abstract function type default value #1667

hellobbq opened this issue Aug 23, 2018 · 5 comments
Assignees
Labels

Comments

@hellobbq
Copy link

hellobbq commented Aug 23, 2018

# zephir
abstract class TestAbstract {
	abstract protected function testFunc(array text = [], string text2 = "", boolean flag = true);
}

# php:
class Test extends TestAbstract {
	protected function testFunc(array $text = [], string $text2 = "", bool $flag = true) {
		// do something...
	}
}

# catch error:
Declaration of Test::testFunc($text, $text2, $flag = true) must be compatible with TestAbstract::testFunc(?array $text, ?string $text2 = NULL, ?bool $flag = NULL)

This happens after the update:
form:
zephir: 0.10.7 zephir-parser: 1.1.1
to:

zephir: 0.11.0
zephir-parser: 1.1.3 or 1.1.1

centos6 php: 7.1

@hellobbq
Copy link
Author

@danhunsaker i found this issues: #457
any solution?

@danhunsaker
Copy link
Contributor

The two aren't related. Sorry I haven't had a chance to look into this one more closely, yet, but it's related to how we're handling type hinting in 0.11.0.

@Jurigag
Copy link
Contributor

Jurigag commented Sep 5, 2018

Then we need to revert it really because it's causing a lot of problems, i've seen the same issues on phalcon repository i think.

@sergeyklay
Copy link
Contributor

@Jurigag Phalcon does not use 0.11.x branch. @hellobbq Could you downgrade to the 0.10.11 and test again?

@sergeyklay sergeyklay self-assigned this Oct 21, 2018
sergeyklay added a commit that referenced this issue Oct 21, 2018
@sergeyklay
Copy link
Contributor

Just fixed this bug for 0.11.x branch in the #1685

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants