# PHP 8 Error "Undefined property"

**URL:** <https://forums.concretecms.org/t/php-8-error-undefined-property/3122>\
**Category:** Developing with Concrete\
**Created:** [May 27, 2022, 3:03pm UTC](https://forums.concretecms.org/t/php-8-error-undefined-property/3122 "2022-05-27T15:03:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![adexec](https://forums.concretecms.org/user_avatar/forums.concretecms.org/adexec/32/3797_2.png) [@adexec](https://forums.concretecms.org/u/adexec)\
**Post date:** [May 27, 2022, 3:03pm UTC](https://forums.concretecms.org/t/php-8-error-undefined-property/3122/1 "2022-05-27T15:03:48Z")

</div>

I have an older slideshow block (originally developed v. 5.7) and want to make it work under v.9 and PHP8. It works fine with PHP7.4 but when I switch to PHP8 it throws an error in the controller:  
**Undefined property: Concrete\Package\InfiniteSlideshow\Block\InfiniteSlideshow\Controller::$fileOrder**

It’s within an if statement:

```auto
if ($this->fileOrder == 'date_asc')
                $fl->sortBy('fDateAdded', 'asc');

```

Can this be done by myself - with basic knowledge of PHP?

Thanks a lot

---

<div class="post-metadata">

**Author:** ![Parasek](https://forums.concretecms.org/user_avatar/forums.concretecms.org/parasek/32/6277_2.png) [@Parasek](https://forums.concretecms.org/u/Parasek)\
**Post date:** [May 27, 2022, 3:24pm UTC](https://forums.concretecms.org/t/php-8-error-undefined-property/3122/2 "2022-05-27T15:24:51Z")

</div>

Yeah, you need to add property in block controller

```auto
public $fileOrder;

```

An it will look something like that:

```auto
class Controller extends BlockController
{
    public $fileOrder;
    // rest of methods
}

```

---

<div class="post-metadata">

**Author:** ![tieusunet](https://forums.concretecms.org/user_avatar/forums.concretecms.org/tieusunet/32/1176_2.png) [@tieusunet](https://forums.concretecms.org/u/tieusunet)\
**Post date:** [May 28, 2022, 1:41pm UTC](https://forums.concretecms.org/t/php-8-error-undefined-property/3122/3 "2022-05-28T13:41:05Z")

</div>

hi thank you. i lke it

---

<div class="post-metadata">

**Author:** ![adexec](https://forums.concretecms.org/user_avatar/forums.concretecms.org/adexec/32/3797_2.png) [@adexec](https://forums.concretecms.org/u/adexec)\
**Post date:** [May 30, 2022, 9:59am UTC](https://forums.concretecms.org/t/php-8-error-undefined-property/3122/4 "2022-05-30T09:59:16Z")

</div>

Thank you very much, that was easy, - even for me. There was another error popping up for “undefined Variable” in view.php. I was able to manage that one too thanks to your instructions
