Is there anything like CoffeeScript for PHP?

后端 未结 10 1765
忘了有多久
忘了有多久 2020-12-08 04:10

PHP interpreters are very common, but the PHP syntax & libraries are inconsistent & cumbersome (IMO, of course). I think a language that compiles into PHP but provid

10条回答
  •  甜味超标
    2020-12-08 04:59

    @gosukiwi made Blueberry, which looks like this:

    /* 
     I'm a multiline comment
    */
    
    a = 1 # variable definition
    
    # you can use JSON syntax to define associative arrays
    arr = { "name": "Mike", "age": 18, "meta": { "items": [1, 2, 3] } }
    
    if a == 1
      echo("Hello, World!")
    end
    
    for i in (0..10)
      echo(i)
    end
    
    class MyClass < MyParentClass
      @name
    
      def Greet
        echo("Hello! My name is " & @name)
      end
    end
    

    They also mentioned it in this comment.

提交回复
热议问题