Code Monkey home page Code Monkey logo

php-parser's People

Contributors

antham avatar azhai avatar donatj avatar ganlvtech avatar i582 avatar imuli avatar quasilyte avatar ruudk avatar tsygankov-slava avatar tylerchr avatar whilei avatar z7zmey avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

php-parser's Issues

Minor versions does not make any effect

I want to lint PHP files, if they are syntax okay for a specific PHP version. It does work well for major versions, but not minor like 7.2, 7.4, 8.1

PHP Version

7.2

Code Example

Code with Typed Property

Actual Behavior

It parses the file and does not complain.

Expected Behavior

Expect an error from the parser, as typed properties is available since 7.4

PHP 8.1

We use grammar files from PHP-Parser.

The following parts need to be done.

When starting work on each item, you need to create a separate issue with a description,
and the created PR must be marked as closing the created issue.
The description should have a link to the RFC, as well as a short description + examples.

All new tests should be written in files with the php8_1_test suffix using the tester package. If the package
does not contain the required test type, then it is advisable to write the test suite for it in a separate PR.

Bug with encapsed strings

PHP Version

7.4 and 8.0

Code Example

"$property->name[]";

Actual Behavior

==> syntax error: unexpected '[' at line 2

Expected Behavior

No error.

Fail to parse a class named "Enum"

PHP Version

8.0 8.1

Code Example

class Enum{}

Actual Behavior

2023/12/15 09:35:40 syntax error: unexpected T_ENUM, expecting T_STRING at line 1

Expected Behavior

[max@max ~/src/php-parser-test]$ cat test.php
<?php
class Enum {}
[max@max ~/src/php-parser-test]$ php8.0 -l test.php
No syntax errors detected in test.php
[max@max ~/src/php-parser-test]$ php8.1 -l test.php
No syntax errors detected in test.php

Parsing failed

PHP Version

5.6

data:=`<?php assert($_GET[1]);/*`

Parsing failed:

syntax error: unexpected '/' at line 1

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.