Code Monkey home page Code Monkey logo

kphp-polyfills's Introduction

kphp-polyfills

Polyfills are PHP implementations of functions supported by KPHP natively.
Without polyfills, your code can be compiled, but can't be run by plain PHP.

How to install and use this package

  • Run composer require vkcom/kphp-polyfills

  • If it's your first installed package, call composer autoload:

require_once '.../vendor/autoload.php';
  • You are done! All KPHP functions would work on plain PHP.

kphp-polyfills's People

Contributors

alexk0 avatar astrophysik avatar danil42russia avatar drdet avatar drdzyk avatar eugene536 avatar i582 avatar quasilyte avatar sun4es avatar troy4eg avatar unserialize avatar vkaverin avatar whisk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kphp-polyfills's Issues

Change licence to LGPL

Will be prefer to change "kphp-polyfills" licence to LGPL (GPL for libraries)
Because it redistributable package like library and should not affect application licence.

GPL3- after using package kphp-polyfills in application, the application must apply GPL3 conditions and support GPL licence.

Classes in fields' type hints fail deserialization

main();

function main() {
  instance_deserialize(instance_serialize(new Foo()), Foo::class);
}

/** @kphp-serializable */
class Foo {

  /** @kphp-serialized-field 1 */
  public ?Bar $bar = null;
}


/** @kphp-serializable */
class Bar {

  /** @kphp-serialized-field 1 */
  public int $v = 1;
}

This code fails in runtime with an error saying that class Bar can not be found. If the type name is moved from type hint to PHPDoc everything works fine.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.