Closed m4tthumphrey closed 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() {}
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?
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.
Ah ok! Wasn't really an issue I was just curious :)
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?