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

Compilation error fix #2

Merged
merged 2 commits into from
Apr 2, 2024
Merged

Conversation

azlymoon
Copy link
Contributor

@azlymoon azlymoon commented Apr 1, 2024

At the moment, when attempting to compile KTemplate, several errors occur:

  1. Insufficient arguments when calling the array_splice function.
  2. Error in using the constant KPHP_COMPILER_VERSION.

The PR addresses the locations where the errors occurred. Now KTemplate compiles and works without issues.

@quasilyte
Copy link
Owner

Could you describe how you tried to run it?
It's supposed to be used along with kphp stubs library that should define KPHP_VERSION constant:
https://github.com/VKCOM/kphp-polyfills/blob/fd09f5532ffa3770a9f458fefe8cdb0729bc1f92/kphp_polyfills.php#L29

The array_splice has default arguments that should be supported by both PHP and KPHP.
https://www.php.net/manual/en/function.array-splice.php

@azlymoon
Copy link
Contributor Author

azlymoon commented Apr 2, 2024

The error with the constant KPHP_COMPILER_VERSION occurs because kphp now works with modulite.
The error message looks like this: [modulite] restricted to use KPHP_COMPILER_VERSION, it does not belong to package #quasilyte/ktemplate

The default value for the parameter length in array_splice was introduced only in PHP8, which is not yet supported by kphp.

@quasilyte quasilyte merged commit c9ce9ba into quasilyte:master Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants