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

Field width 536870912 is too long #2144

Closed
BladeMF opened this issue Mar 17, 2023 · 9 comments
Closed

Field width 536870912 is too long #2144

BladeMF opened this issue Mar 17, 2023 · 9 comments
Labels

Comments

@BladeMF
Copy link
Contributor

BladeMF commented Mar 17, 2023

I keep getting this error for some reason:
Fatal error: Field width 536870912 is too long in /root/.shared_extensions/phpactor3/lib/WorseReflection/Core/Type/StringLiteralType.php on line 34

the code there is this:

        if ($right instanceof StringLiteralType) {
            return new self(sprintf('%s%s', $this->value, (string)$right->value()));
        }
@BladeMF
Copy link
Contributor Author

BladeMF commented Mar 17, 2023

Tried changing to:

return new self(sprintf('%1024s%1024s', $this->value, (string)$right->value()));

but no luck yet.

@BladeMF
Copy link
Contributor Author

BladeMF commented Mar 17, 2023

This saved me:

			return new self(sprintf(
				'%s%s',
				substr($this->value, 0, 1024),
				substr((string)$right->value(), 1024)
			));

@BladeMF
Copy link
Contributor Author

BladeMF commented Mar 17, 2023

Still not sure what caused it.

@dantleech
Copy link
Collaborator

Yes that should definitely have been truncated, there us little to no value in storing the contents if the string

@dantleech dantleech added the bug label Mar 19, 2023
@dantleech
Copy link
Collaborator

would you be willing to create a PR?

@BladeMF
Copy link
Contributor Author

BladeMF commented Mar 19, 2023

Sure, but I am not sure what the length should be. I am a bit overwhelmed at the moment - I've been putting off my PR about switches for enabling and disabling different language server services for a very long time now, but I hope in a couple of weeks I would be able to.

@dantleech
Copy link
Collaborator

dantleech commented Mar 19, 2023

no worries, but basically the length can be arbitrary, e.g. 255 chars, maybe adding ... if it's truncated

@BladeMF
Copy link
Contributor Author

BladeMF commented Mar 19, 2023

Sounds good.

@dantleech
Copy link
Collaborator

should be fixed as of #2200

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

2 participants