:herb: NodeJS PHP Parser - extract AST or tokens (PHP5 and PHP7)

Overview

php-parser

Coverage Status

This javascript library parses PHP code and convert it to AST.

Installation

This library is distributed with npm :

npm install php-parser --save

Usage

// initialize the php parser factory class
var fs = require('fs');
var path = require('path');
var engine = require('php-parser');

// initialize a new parser instance
var parser = new engine({
  // some options :
  parser: {
    extractDoc: true,
    php7: true
  },
  ast: {
    withPositions: true
  }
});

// Retrieve the AST from the specified source
var eval = parser.parseEval('echo "Hello World";');

// Retrieve an array of tokens (same as php function token_get_all)
var tokens = parser.tokenGetAll('<?php echo "Hello World";');

// Load a static file (Note: this file should exist on your computer)
var phpFile = fs.readFileSync( './example.php' );

// Log out results
console.log( 'Eval parse:', eval );
console.log( 'Tokens parse:', tokens );
console.log( 'File parse:', parser.parseCode(phpFile) );

Sample AST output

{
  'kind': 'program',
  'children': [
    {
      'kind': 'echo',
      'arguments': [
        {
          'kind': 'string',
          'isDoubleQuote': true,
          'value': 'Hello World'
        }
      ]
    }
  ]
}

API Overview

The main API exposes a class with the following methods :

  • parseEval(String|Buffer) : parse a PHP code in eval style mode (without php open tags)
  • parseCode(String|Buffer, String filename) : parse a PHP code by using php open tags.
  • tokenGetAll(String|Buffer) : retrieves a list of all tokens from the specified input.

You can also pass options that change the behavior of the parser/lexer.

Documentation

Related projects

  • prettier/plugin-php : Prettier PHP Plugin
  • babel-preset-php : Babel preset for converting PHP syntax to JavaScript. It can run subset of PHP in the browser or in Node.js
  • wp-pot : Generate pot file for WordPress plugins and themes
  • crane : PHP Intellisense/code-completion for VS Code
  • php-unparser : Produce code that uses the style format recommended by PSR-1 and PSR-2.
  • php-writer : Update PHP scripts from their AST
  • ts-php-inspections : Provide PHP code inspections written in typescript
  • php-reflection : Reflection API for PHP files
  • vscode-phpunit : vscode phpunit extension
  • lua2php : a Lua to PHP transpiler

You can add here your own project by opening an issue request.

License

This library is released under BSD-3 license clause.

FOSSA Status

Comments
  • Migration to webpack

    Migration to webpack

    Project build

    A little recap, grunt is old and slower compared to webpack so I proposed to migrate to it. This is the build setup using webpack, I've also added the browser field to package.json file pointing to the unminified build for the web projects, it's not ready yet to fully replace grunt we must move the documentation generator also... I've tried also to replicate the grunt-documentation plugin using the documentation npm module but the output is quite different and I don't understand why since the options are the same, probably it's because I'm using a newer version.


    Project documentation

    TL;DR DEMO

    This is the file I've made for programmatical use of documentationjs, but the output is somehow different :( probably depends of the newer version, but I don't know exactly.

    I've created another branch to try out jsdoc with this project and managed to make it work after fixing a couple of tags errors, there are still some checks to do, regards examples and other parts of the documentation to ensure they match the jsdoc standard... but this is a preview of the result.

    This is the default theme, if you like this solution we can use the theme you like more.

    I think in terms of readability and usability is better than the wiki pages, I admit I'm used to read stuff in github, I spend most of my time on it, but since jsdoc (esdoc, tsdoc and friends) are widely used I feel familiar to move around the documentation generated by that tools.


    The idea is to migrate the documentation, merge it in the webpack branch and than merge back into v3.1. What do you think about it?

    enhancement 
    opened by b4dnewz 24
  • [feature] implement trailingComments on nodes

    [feature] implement trailingComments on nodes

    Related to #189 issue, the parser should be able to extract comments on trailingComments in order to better represent their position on the document.

    Sample use case : https://astexplorer.net/#/gist/2674d53a98c68e273b96adaa99047e61/5c6bbdbfad0d9996203e56dcfae8659ec593fc57

    enhancement AST RELEASE-READY high-pri 
    opened by ichiriac 15
  • invalid ast for offsetlookup and encapsed

    invalid ast for offsetlookup and encapsed

    Input:

    $var = "string ${juices['FOO']} string";
    

    Encapsedpart node contains variable node, but should contains offsetlookup node.

    PHP parser output:

    array(
        0: Stmt_Expression(
            expr: Expr_Assign(
                var: Expr_Variable(
                    name: var
                )
                expr: Scalar_Encapsed(
                    parts: array(
                        0: Scalar_EncapsedStringPart(
                            value: string 
                        )
                        1: Expr_ArrayDimFetch(
                            var: Expr_Variable(
                                name: juices
                            )
                            dim: Scalar_String(
                                value: FOO
                            )
                        )
                        2: Scalar_EncapsedStringPart(
                            value:  string
                        )
                    )
                )
            )
        )
    )
    

    Expr_ArrayDimFetch is same as offsetlookup

    Maybe will be great add tests for propertylookup and staticlookup to ensure ast correct for lookup nodes.

    bug AST RELEASE-READY high-pri 
    opened by alexander-akait 14
  • feat(php8 attributes): building on lexer PR

    feat(php8 attributes): building on lexer PR

    Builds on #724 lexer functionality.

    PHP 8 Attribute Features:

    • [x] Class
    • [x] Methods
    • [x] Method Params
    • [x] Class Variables
    • [x] Inline Functions fn()..
    • [x] Functions
    • [x] Anonymous Classes
    • [x] Class Constants
    • [x] Interfaces
    opened by cseufert 13
  • Don't output `null` for last element in `list/array`

    Don't output `null` for last element in `list/array`

    Input:

    list(,$first, $second, $three, $fourth,) = $arr;
    

    Contain null in arguments.

    Babylon example: https://astexplorer.net/#/gist/6d37953c6b42f02a3ffe48b6101127c3/745b62f49d2c011d789e6d9754a4d705db5cdab0

    I think it is unnecessary, because it is doesn't have sense for executing/parsing/printing/etc.

    enhancement AST high-pri 
    opened by alexander-akait 12
  • again and again regression

    again and again regression

    Input:

    $var = $var + $var ?? '';
    

    Input:

    function gen() {
      yield 0;
      yield from from();
      yield 4;
    }
    

    I honestly can’t understand what the problem is, why you can not devote a little more time to tests and details, what is the problem of being more responsible for the project or asking for help (hi, i am here and can test branches before merge :hand: )?

    Each update is pain and regressions :disappointed:

    I understand that we all have work here and a little time, but what is the problem to wait for the review and feedback before merge?

    code-climate 
    opened by alexander-akait 11
  • Snapshot testing

    Snapshot testing

    Currently, a typical test looks roughly like this:

      it("test coalesce operator", function() {
        var ast = parser.parseEval("$var = $a ?? true;");
        ast.children[0].right.kind.should.be.exactly("bin");
        ast.children[0].right.type.should.be.exactly("??");
        ast.children[0].right.left.kind.should.be.exactly("variable");
        ast.children[0].right.right.kind.should.be.exactly("boolean");
    });
    

    After working with snapshot-based testing for a while in prettier/plugin-php, I've really come to appreciate not having to write my own assertions anymore.

    If we were to introduce snapshot-based testing here, the test case above would essentialy boil down to just one line, which could even be stored in a .php file:

    $var = $a ?? true;
    

    The testing framework would then generate the snapshot and save it in a file:

    {
      "kind": "program",
      "children": [
        {
          "kind": "assign",
          "operator": "=",
          "left": {
            "kind": "variable",
            "name": "var",
            "byref": false,
            "curly": false
          },
          "right": {
            "kind": "bin",
            "type": "??",
            "left": {
              "kind": "variable",
              "name": "a",
              "byref": false,
              "curly": false
            },
            "right": {
              "kind": "boolean",
              "value": true,
              "raw": "true"
            }
          }
        }
      ],
      "errors": []
    }
    

    Like this, we'd see the exact AST changes that every PR introduces to any of the existing test cases.

    It seems that Esprima is using a similar approach.

    If you're interested, I could try preparing a little proof of concept - let me know what you think! 😄

    enhancement help wanted AST good first issue 
    opened by czosel 11
  • Parser crashes when encountering property call inside string

    Parser crashes when encountering property call inside string

    So I have some code: echo "test: $this->prop->foo".

    When trying to parse this code, the parser crashes without an error, however adding { } around the property call resolves the issue and it parses successfully.

    So echo "test: {$this->prop->foo}" works.

    Even if this behaviour is not allowed in PHP, the parser should throw an exception so it can be caught on the user side. Currently this code crashes my application without warning, regardless if I use a try/catch block or not.

    bug 
    opened by nevadascout 11
  • Issue with comment

    Issue with comment

    Great job with this module, It's almost perfect but the parseCode method is skipping the comment. We would like to use the parser to decompose and rewrite our php class (in order to enrich them), but, it's actually impossible to rewrite without the comments (for obvious reason). Is it possible to add this feature to your module? Regards.

    enhancement question 
    opened by bsauveton 11
  • Added support for static lookup on property

    Added support for static lookup on property

    Example

    $this->foo::bar;
    

    I don't see any rfc or documentation for this feature but it does work in php 7.0, iv been using it in production for quit a while.

    opened by bbtgp 10
  • Support 7.2

    Support 7.2

    • [x] Trailing Commas In List Syntax : https://wiki.php.net/rfc/list-syntax-trailing-commas
    • [x] Object typehint : https://wiki.php.net/rfc/object-typehint
    • [x] Short list syntax : https://wiki.php.net/rfc/short_list_syntax
    enhancement php7 php-langspec 
    opened by ichiriac 10
  • build(deps-dev): bump husky from 8.0.2 to 8.0.3

    build(deps-dev): bump husky from 8.0.2 to 8.0.3

    Bumps husky from 8.0.2 to 8.0.3.

    Release notes

    Sourced from husky's releases.

    v8.0.3

    • fix: add git not installed message #1208
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • add a wiki page for all the available options/configs and what each is for ?

    add a wiki page for all the available options/configs and what each is for ?

    atm checking https://php-parser.glayzzle.com/guides/options doesnt show all the available options/config ex.php7 which am not sure if its even needed anymore.

    or whats the diff between this two

    parser: {
        locations: true,
    },
    ast: {
        withPositions: true
    }
    
    opened by ctf0 0
  • Rough draft of support for readonly class

    Rough draft of support for readonly class

    Is this approach ok?

    According to https://php.watch/versions/8.2/readonly-classes

    Abstract classes final classes can also be declared readonly. The order of the keywords does not make a difference.

    I know some tests will fail, I am showing this to verify that my approach is ok.

    opened by genintho 5
  • build(deps-dev): bump webpack-cli from 4.10.0 to 5.0.1

    build(deps-dev): bump webpack-cli from 4.10.0 to 5.0.1

    Bumps webpack-cli from 4.10.0 to 5.0.1.

    Release notes

    Sourced from webpack-cli's releases.

    v5.0.1

    5.0.1 (2022-12-05)

    Bug Fixes

    • make define-process-env-node-env alias node-env (#3514) (346a518)

    v5.0.0

    5.0.0 (2022-11-17)

    Bug Fixes

    • improve description of the --disable-interpret option (#3364) (bdb7e20)
    • remove the redundant utils export (#3343) (a9ce5d0)
    • respect NODE_PATH env variable (#3411) (83d1f58)
    • show all CLI specific flags in the minimum help output (#3354) (35843e8)

    Features

    • failOnWarnings option (#3317) (c48c848)
    • update commander to v9 (#3460) (6621c02)
    • added the --define-process-env-node-env option
    • update interpret to v3 and rechoir to v0.8
    • add an option for preventing interpret (#3329) (c737383)

    BREAKING CHANGES

    • the minimum supported webpack version is v5.0.0 (#3342) (b1af0dc), closes #3342
    • webpack-cli no longer supports webpack v4, the minimum supported version is webpack v5.0.0
    • webpack-cli no longer supports webpack-dev-server v3, the minimum supported version is webpack-dev-server v4.0.0
    • remove the migrate command (#3291) (56b43e4), closes #3291
    • remove the --prefetch option in favor the PrefetchPlugin plugin
    • remove the --node-env option in favor --define-process-env-node-env
    • remove the --hot option in favor of directly using the HotModuleReplacement plugin (only for build command, for serve it will work)
    • the behavior logic of the --entry option has been changed - previously it replaced your entries, now the option adds a specified entry, if you want to return the previous behavior please use webpack --entry-reset --entry './src/my-entry.js'
    Changelog

    Sourced from webpack-cli's changelog.

    5.0.1 (2022-12-05)

    Bug Fixes

    • make define-process-env-node-env alias node-env (#3514) (346a518)

    5.0.0 (2022-11-17)

    Bug Fixes

    • improve description of the --disable-interpret option (#3364) (bdb7e20)
    • remove the redundant utils export (#3343) (a9ce5d0)
    • respect NODE_PATH env variable (#3411) (83d1f58)
    • show all CLI specific flags in the minimum help output (#3354) (35843e8)

    Features

    • failOnWarnings option (#3317) (c48c848)
    • update commander to v9 (#3460) (6621c02)
    • added the --define-process-env-node-env option
    • update interpret to v3 and rechoir to v0.8
    • add an option for preventing interpret (#3329) (c737383)

    BREAKING CHANGES

    • the minimum supported webpack version is v5.0.0 (#3342) (b1af0dc), closes #3342
    • webpack-cli no longer supports webpack v4, the minimum supported version is webpack v5.0.0
    • webpack-cli no longer supports webpack-dev-server v3, the minimum supported version is webpack-dev-server v4.0.0
    • remove the migrate command (#3291) (56b43e4), closes #3291
    • remove the --prefetch option in favor the PrefetchPlugin plugin
    • remove the --node-env option in favor --define-process-env-node-env
    • remove the --hot option in favor of directly using the HotModuleReplacement plugin (only for build command, for serve it will work)
    • the behavior logic of the --entry option has been changed - previously it replaced your entries, now the option adds a specified entry, if you want to return the previous behavior please use webpack --entry-reset --entry './src/my-entry.js'
    Commits
    • 4a0f893 chore(release): publish new version
    • 9de982c chore: fix cspell
    • 32d26c8 chore(deps-dev): bump cspell from 6.15.1 to 6.16.0 (#3517)
    • 2788bf9 chore(deps-dev): bump eslint from 8.28.0 to 8.29.0 (#3516)
    • ac88ee4 chore(deps-dev): bump lint-staged from 13.0.4 to 13.1.0 (#3515)
    • 346a518 fix: make define-process-env-node-env alias node-env (#3514)
    • 3ec7b16 chore(deps): bump yeoman-environment from 3.12.1 to 3.13.0 (#3508)
    • c8adfa6 chore(deps-dev): bump @​types/node from 18.11.9 to 18.11.10 (#3513)
    • 0ad8cc2 chore(deps-dev): bump cspell from 6.15.0 to 6.15.1 (#3512)
    • d30f261 chore(deps-dev): bump ts-loader from 9.4.1 to 9.4.2 (#3511)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • AST type inconsistencies

    AST type inconsistencies

    I encountered the following source discrepancies while moving my AST->PHP writer from any types to strict typing. They are tolerable in JavaScript but cause problems in a type safe TypeScript:

    • continue and break aren't consistent in their level, one uses a plain number while the other a Number extended from Node.
    • empty extends Expression and uses an expression property but it isn't actually defined as such (empty.js fails to mention the property, consequently, it isn't generated into types.d.ts).
    • isset is the same with the variables property,
    • print is the same with the expression property,
    • unset is the same with the variables property.
    • namedargument is lowercase, all other node types have PascalCase names.
    • String normally contains the whole string, with the appropriate quotes, as dictated by isDoubleQuote. However, EncapsedPart can also contain a String fragment and that has no quotes of its own. Although I can work around this, the perfectly correct solution would require either an isQuoted property for String or a new node type like EncapsedString to be used just here.
    • Repeated case labels are stored rather problematically, they are empty Case branches with no relation to the actual branch they belong to. They should be consolidated into a single Case instead, with a test property of Expression[] instead of a single expression.
    • Property and Constant both are supposed to have a name of simple type string. In reality, they receive an Identifier.
    • UseGroup defines an item property but actually populates one named items.
    • The type field of Function can be null, too.

    And something not actually an error but a very needed, very small addition: Node should have a parent property and it should be populated when the AST is generated. It's of paramount importance for any tree manipulation. I can also work around this by using my additional union type and populating it during my own traversal but it would be a very cheap addition to the core.

    opened by deakjahn 0
  • Modifying the AST

    Modifying the AST

    Was the AST ever intended to be modified externally? I've just written an AST->PHP writer (yes, I'm aware of php-writer, it's very old and dated, I needed the full support up to the latest PHP 8.1). It's in TypeScript, actually, not JavaScript. I didn't yet have time to test it at all but I'm more than willing to share it as soon as it's reasonably error free.

    However, this leads to the current question. I'd need to modify the AST so that I can export it in full or partly back to PHP. Was php-parser ever intended to support this scenario? The various AST classes don't seem to have constructors and there seems to be no easy way to build or modify an AST tree (except for assembling PHP strings and parsing them eval-style but that's not what would really be needed).

    opened by deakjahn 4
Releases(v3.1.2)
  • v3.1.2(Nov 1, 2022)

  • v3.1.1(Sep 13, 2022)

  • v3.1.0(Aug 10, 2022)

  • v3.1.0-beta.11(Jul 2, 2022)

    • Handle property types using T_NAME_* tokens (#960, thanks @MaartenStaa!)
    • Implement parsing of PHP 8.1's explicit octals (#961, thanks @MaartenStaa!)
    • Dependency updates
    Source code(tar.gz)
    Source code(zip)
  • v3.1.0-beta.10(Jun 10, 2022)

  • v3.1.0-beta.9(May 30, 2022)

  • v3.1.0-beta.8(May 25, 2022)

  • v3.1.0-beta.7(May 23, 2022)

  • v3.1.0-beta.6(May 22, 2022)

    • fix: parse namespaces as single tokens (#921, thanks @MaartenStaa!)
    • fix: attribute parsing issues (#918, thanks @MaartenStaa!)
    • fix: intersection types with by-ref variable (#917, thanks @justim!)
    • chore: upgrade dependencies (#932)
    Source code(tar.gz)
    Source code(zip)
  • v3.1.0-beta.5(Mar 5, 2022)

    • feat: Parse Intersection types (#893, thanks @cseufert and @genintho!)
    • fix: several small typing issues (#871, thanks @cpiber!)
    • chore: add performance testing to CI (#885 - #890)
    Source code(tar.gz)
    Source code(zip)
  • v3.1.0-beta.4(Feb 20, 2022)

  • v3.1.0-beta.3(Feb 20, 2022)

  • v3.1.0-beta.2(Feb 18, 2022)

  • v3.1.0-beta.1(Feb 5, 2022)

    • add support for parsing PHP 8.1 enums (#862, thanks @MaartenStaa)
    • fix 589 new keyword params (#750, thanks @cseufert)
    • chore(linting): enable "braces" eslint rule (#863, thanks @cseufert)
    Source code(tar.gz)
    Source code(zip)
  • 3.1.0-beta.0(Feb 3, 2022)

  • 3.0.1(Apr 24, 2020)

  • 3.0.0(Mar 28, 2020)

  • 3.0.0-prerelease.9(Aug 15, 2019)

    3.0.0-prerelease.9 : (2019-08-15)

    • #291 : Incorrect parsing of backslash-prefixed use declarations
    • #278 : 3.0 - Confusing commentsBlocks references
    • #256 : invalid ast for multiple properties
    • #255 : better ast for constant node
    • #250 : Leading comments are treated as trailing comments to the previous function body
    • #248 : broken ast for $$$$$
    • #247 : invalid ast for silent
    • #246 : resolution for classreference doesn't work properly for FULL_QUALIFIED_NAME
    • #242 : feat: improve Declare node and introduce DeclareDirective node
    • #199 : [bug] comment location overlaps with node location for static node
    • #192 : [bug] encapsed and staticlookup
    • #180 : bug in parser with single function
    • #174 : Don't output null for last element in list/array
    • #128 : Don't have curly for propertylookup in offset
    Source code(tar.gz)
    Source code(zip)
  • 3.0.0-prerelease.8(Jan 7, 2019)

    • #235 : invalid ast for self and parent
    • #234 : regression with parens in 3.0.0-prerelease.7
    • #230 : resolvePrecedence break location for bin nodes
    • #202 : [bug] comment position in lookup
    • #194 : [feature] implement trailingComments on nodes
    • #185 : [bug] parens and staticlookup
    • #172 : cast precedence
    • #182 : strange with parens, staticlookup and offsetlookup
    • #167 : staticlookup is broken with curly
    • #239 : [bug] call should be in ExpressionStatement
    • #207 : [feature] use identifier for class/interface/trait name
    • #243 : Regression in prerelease 7 with echo
    • #181 : strange with parens and unary
    Source code(tar.gz)
    Source code(zip)
  • 3.0.0-prerelease.7(Nov 10, 2018)

    • #201 : [bug] curly in staticlookup bug
    • #175 : impossible detect curly in encapsed AST enhancement
    • #210 : [bug] invalid ast for const enhancement
    • #220 : regression in rc-6
    • #204 : [bug] invalid start offset encapsed AST bug
    • #165 : declare doesn't support inline nodes investigating

    Many thanks to @evilebottnawi for his help

    Source code(tar.gz)
    Source code(zip)
  • 3.0.0-prerelease.5(Sep 30, 2018)

  • 3.0.0-prerelease.4(Sep 8, 2018)

  • 3.0.0-alpha.3(Aug 15, 2018)

    • fix #168 : End location of if without semicolon
    • impl #147 : Node informations about Binary and unicode strings
    • impl #83 : Adding full support for PHP 7.2
    • fix #122 : Detect foreach bad syntax
    • impl #152 : Improve tests with JEST
    • fix #164 : Fixing some location issues (partial)
    Source code(tar.gz)
    Source code(zip)
  • 3.0.0-alpha2(Apr 14, 2018)

    • fix #137 : Bug with parsing list
    • fix #149 : Binary cast: isDoubleQuote incorrect
    • fix #150 : strange ast with list
    • fix #151 : Declare inside if
    Source code(tar.gz)
    Source code(zip)
  • 3.0.0-alpha1(Apr 11, 2018)

  • 2.2.0(Dec 28, 2017)

    This release will be the latest on 2.x series, the future releases on 2.2.x branch will be only bugfixes, if you are using a <2.1.x you should consider using this lastest version as it contains a lot of bugfixes.

    NOTE : The next 3.0 will be released soon (few days).

    • Impl #108 : add an option to disable PHP7 support
    • Fix #107 : fix T_DOUBLE_COLON handler
    • Fix #106 : infinite loops from lexer (unput)
    • Fix #105 : T_DOLLAR_OPEN_CURLY_BRACES handles now expressions
    • PR #102 : Normalize the way type casts are defined
    • Fix #103 : Fix critical cast to null confusion
    Source code(tar.gz)
    Source code(zip)
  • 2.1.0(Nov 1, 2017)

  • 2.0.7(Sep 3, 2017)

  • 2.0.6(Jul 16, 2017)

  • 2.0.4(Jul 9, 2017)

    • Fix AST errors on suppressErrors
    • Add curly boolean on variable node (for ${bar} syntax)
    • Implement the static closure flag, ex: $c = static function() {};
    Source code(tar.gz)
    Source code(zip)
Owner
glayzzle
PHP transpiler for Javascript/NodeJS
glayzzle
Open source rich text editor based on HTML5 and the progressive-enhancement approach. Uses a sophisticated security concept and aims to generate fully valid HTML5 markup by preventing unmaintainable tag soups and inline styles.

This project isn’t maintained anymore Please check out this fork. wysihtml5 0.3.0 wysihtml5 is an open source rich text editor based on HTML5 technolo

Christopher Blum 6.5k Jan 7, 2023
A simple, beautiful, and embeddable JavaScript Markdown editor. Delightful editing for beginners and experts alike. Features built-in autosaving and spell checking.

SimpleMDE - Markdown Editor A drop-in JavaScript textarea replacement for writing beautiful and understandable Markdown. The WYSIWYG-esque editor allo

Sparksuite 9.3k Jan 4, 2023
Open source rich text editor based on HTML5 and the progressive-enhancement approach. Uses a sophisticated security concept and aims to generate fully valid HTML5 markup by preventing unmaintainable tag soups and inline styles.

This project isn’t maintained anymore Please check out this fork. wysihtml5 0.3.0 wysihtml5 is an open source rich text editor based on HTML5 technolo

Christopher Blum 6.5k Dec 30, 2022
Personal blog and portfolio with a admin panel and comment system.

Implementation of a Full Stack Blog With a Comment System And Admin Panel With PHP, React & MYSQL FULL DOCUMENTATION SITE LINK Contents Database Desig

Andres Arturo Rodriguez Calderon 22 Oct 21, 2022
A modern, simple and elegant WYSIWYG rich text editor.

jQuery-Notebook A simple, clean and elegant WYSIWYG rich text editor for web aplications Note: Check out the fully functional demo and examples here.

Raphael Cruzeiro 1.7k Dec 12, 2022
Quill is a modern WYSIWYG editor built for compatibility and extensibility.

Note: This branch and README covers the upcoming 2.0 release. View 1.x docs here. Quill Rich Text Editor Quickstart • Documentation • Development • Co

Quill 34.3k Jan 2, 2023
A web-based tool to view, edit, format, and validate JSON

JSON Editor JSON Editor is a web-based tool to view, edit, format, and validate JSON. It has various modes such as a tree editor, a code editor, and a

Jos de Jong 10.1k Jan 4, 2023
The world's #1 JavaScript library for rich text editing. Available for React, Vue and Angular

TinyMCE TinyMCE is the world's most advanced open source core rich text editor. Trusted by millions of developers, and used by some of the world's lar

Tiny 12.4k Jan 4, 2023
A lightweight and amazing WYSIWYG JavaScript editor - 20kB only (8kB gzip)

Supporting Trumbowyg Trumbowyg is an MIT-licensed open source project and completely free to use. However, the amount of effort needed to maintain and

Alexandre Demode 3.8k Jan 7, 2023
:notebook: Our cool, secure, and offline-first Markdown editor.

Monod Hi! I'm Monod, the Markdown Editor! Monod is a (relatively) secure and offline-first Markdown editor we have built at TailorDev in order to lear

TailorDev 877 Dec 4, 2022
ppo is a super small and useful utils library for JavaScript 🐝🐜

Overview Every frontend developer has written his own utils library, and we often write methods that are easily forgotten and highly used. ppo is a su

anonymous namespace 105 Jul 21, 2022
⚗️ Zeplin extension that generates Swift snippets from colors, fonts, and layers

Zeplin extension that generates Swift snippets from colors, fonts and layers. Features ?? Color pallette for iOS Example import UIKit extension UICol

Artem Novichkov 83 May 29, 2022
Add to your GitHub readme a badge that shows your Discord username and presence (online/idle/do not disturb/offline)!

Discord Profile Markdown badge Add to your GitHub readme a badge that shows your Discord username and presence! Set up Join the Discord server (requir

Monty 82 Dec 30, 2022
Like codepen and jsbin but works offline.

Like codepen and jsbin but works offline.

EGOIST 1.1k Jan 2, 2023
🍞🎨 Full-featured photo image editor using canvas. It is really easy, and it comes with great filters.

Full featured image editor using HTML5 Canvas. It's easy to use and provides powerful filters. ?? Packages toast-ui.image-editor - Plain JavaScript co

NHN 5.7k Dec 28, 2022
A editor with the main features created using Remirror and with a special code block

A editor with the main features created using Remirror and with a special code block

Brenda Profiro 26 Sep 20, 2022
The best enterprise-grade WYSIWYG editor. Fully customizable with countless features and plugins.

CKEditor 4 - Smart WYSIWYG HTML editor A highly configurable WYSIWYG HTML editor with hundreds of features, from creating rich text content with capti

CKEditor Ecosystem 5.7k Dec 27, 2022
An Easy and Fast WYSIWYG Editor

Simditor Simditor is a browser-based WYSIWYG text editor. It is used by Tower -- a popular project management web application. Supported Browsers: IE1

彩程设计 5k Jan 3, 2023
Typewriter is a simple, FOSS, Web-based text editor that aims to provide a simple and intuitive environment for you to write in.

Typewriter Typewriter is a simple, FOSS, Web-based text editor that aims to provide a simple and intuitive environment for you to write in. Features S

Isla 2 May 24, 2022