• Resolved paulbeck

    (@paulbeck)


    I just updated PHP on my development machine to 5.6.40-5. fancybox.php now gets an error on line 236. With this version of PHP, it is now considered an error to reference/use an undefined variable. Previously, it was a silent error. Now it generates an error message in the page.

    The line (236) in error is $afterLoad .= ‘””‘; Looking at the rest of the if/else statements, this should have been a direct assignment, not a concatenation. The other two sections are a direct assignment. Obviously, $afterLoad is not defined at the start of this if statement. I have changed my local copy to be $afterLoad = ‘””‘; This works fine. Please incorporate this change in you next release.

    I suspect FancyBox for WordPress does not support PHP 7.x. I am planning to upgrade my site to PHP 7 soon, so I was wondering if you have plans to upgrade to PHP 7 compatability. As I work on my local dev system to upgrade to PHP 7, I will be discovering plug-in incompatability. If you like, I can report to you what problems I find with fancybox.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello @paulbeck,

    The error you see might be because you have an older PHP version.
    We tested this plugin with PHP 7.x and it works as it should.
    This is also the recommended version by WordPress: https://ww.wp.xz.cn/about/requirements/

    I recommend updating to a newer version. Please let me know what you find.
    I will also open a ticket regarding this so we can investigate further.

    Thank you so much,
    Mihaela

    Thread Starter paulbeck

    (@paulbeck)

    This error was found when I UPDATED my PHP from 5.6.33 to 5.6.40, and I mentioned in my original post. Also, if you look at the line I mention, you will see the issue with using an undefined variable. Also, look at all three sections of the if/else clause and you will see that the first two are a direct assignment of $afterLoad, and the last is concatenation with an undefined $afterLoad.

    I think you might have looked at the code lines I mentioned before “Resolving” this post.

    Thread Starter paulbeck

    (@paulbeck)

    Updated PHP to 7.2. No more problems. Thanks.

    Happy to hear it works now!
    If you have any other questions please don’t hesitate to ask.

    Best wishes,
    Mihaela

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Error with PHP 5.6.40’ is closed to new replies.