kzykhys / Ciconia

A New Markdown parser for PHP5.4
http://ciconia.kzykhys.com/
MIT License
355 stars 31 forks source link

Array syntax? #10

Closed m4tthumphrey closed 10 years ago

m4tthumphrey commented 10 years ago

Original title was 'Why 5.4?' but just noticed you are using traits.

Yes I could easily dig through the code (and I have to an extent) but I was wondering what the need for 5.4 was?

I noticed that you are not using the new short array syntax $array = []; (which was introduced in 5.4), any reason why?

kzykhys commented 10 years ago

Using traits is the reason, and also Closure behavior.


    public function foo(Text $text)
    {
        $text->replace('/.*/', function () {
            $this->bar(); // Accessing $this inside a closure (since 5.4)
        });
    }

    public function bar() {}
m4tthumphrey commented 10 years ago

Yes I figured that in end, as you can see in my edited description! How come you didn't use the 5.4 short array syntax, just out of interest?

kzykhys commented 10 years ago

No, php 5.3 was the target version when I started this project. Just initial code is remaining :cry:

I found my short array syntax usage.

Closing this issue because I can't go back to 5.3 anymore.

m4tthumphrey commented 10 years ago

Ah ok! Wasn't really an issue I was just curious :)