Announcement

Collapse
No announcement yet.

Changes Being Worked On For PHP 7.1

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Changes Being Worked On For PHP 7.1

    Phoronix: Changes Being Worked On For PHP 7.1

    PHP 7.1 is coming later this year as the first significant update to last year's PHP 7 release that delivered huge speed improvements...

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite

  • #2
    I would like to see method & class decorators.

    Code:
    [Authorize]
    public function Foo() {
        return "Foo";
    }
    See the [Authorize] attribute for example.

    Comment


    • #3
      Originally posted by uid313 View Post
      I would like to see method & class decorators.

      Code:
      [Authorize]
      public function Foo() {
      return "Foo";
      }
      See the [Authorize] attribute for example.
      what does it do?

      Comment


      • #4
        oh nice - typed properties has a really good chance in shortening the top of most of my classes...

        this...
        PHP Code:
        class Example
        {
          
        /**
           * @var SomeThing
          */
          
        protected $someThing
        }

          public function(
        SomeThing $someThing)
          {
            
        $this->someThing $someThing;
          } 
        becomes...
        PHP Code:
        class Example
        {
          protected 
        SomeThing $something

          
        public function(SomeThing $someThing
          {
            
        $this->someThing $someThing;
          }

        Comment


        • #5
          Originally posted by uid313 View Post
          I would like to see method & class decorators.

          Code:
          [Authorize]
          public function Foo() {
          return "Foo";
          }
          See the [Authorize] attribute for example.
          It does not look like the PHP Attributes RFC is going to get up (this time). Having a formalised syntax instead of relying on DocBlocks would be really cool, but I guess they need to get it right before accepting any implementation

          Comment


          • #6
            Originally posted by cj.wijtmans View Post
            what does it do?
            [Authorize] is just an example of a hypothetical attribute, but it can really be anything.
            It allows you to decorate a method with an attribute or decorator and then when you call that method the attribute gets called before.

            It exist in C# as [Attribute], and in Python and Java as @attribute.

            Comment

            Working...
            X