PHP Parse Error (works in leetcode) #163

Open
opened 2025-02-07 18:41:57 -06:00 by aaharr · 0 comments
aaharr commented 2025-02-07 18:41:57 -06:00 (Migrated from github.com)

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!

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. ```php 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!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
arduinohatesme/leetcode.nvim#163
No description provided.