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

PHP Parse Error (works in leetcode) #163

Open
aaharr opened this issue Feb 8, 2025 · 0 comments
Open

PHP Parse Error (works in leetcode) #163

aaharr opened this issue Feb 8, 2025 · 0 comments

Comments

@aaharr
Copy link

aaharr commented Feb 8, 2025

Howdy! I love this tool 🥰
Been using it for C and Python 🙌
Brushing up on PHP...

I'm getting this just sending anything into "test" for PHP

	│ Line 40: PHP Parse error:  syntax error, unexpected identifier "_driver", expecting "function" or "const" in solution.php

This feels like something is lost in translation on the way to the leetcode api? '_driver' feels very backend

To repro:

Pop some simple code like this in. Stdout appears in leetcode, but error appears in leetcode.nvim.

class Solution {

    /**
     * @param Integer[] $nums
     * @param Integer $target
     * @return Integer[]
     */
    function twoSum($nums, $target) {
        foreach ($nums as $num) {
        echo $num;
    }
        
    }
}

Let me know if anything else is needed or if your experience is different!

@aaharr aaharr changed the title PHP Line 40: PHP Parse error: syntax error, unexpected identifier "_driver", expecting "function" or "const" in solution.php PHP Parse Error (works in leetcode) Feb 8, 2025
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

No branches or pull requests

1 participant