Compatibility with PHP 7 - how hard?

23 views
Skip to first unread message

lkasdorf

unread,
Dec 3, 2019, 6:58:04 PM12/3/19
to Php Object Generator
One of the sites that I built with PHP object generator has upgraded to PHP 7.

Things largely work, but I notice that when I run code that calls a plugin, it fails. Alas, I've not been able to see any errors in logs. I'm trying to debug this in a shared hosting environment.
Looking at the code of a generated class, I see at least one incompatibility- the class constructors are the same name as the class- which is a php 7 no-no.

I wonder if anybody reading this has tried to convert POG generated code to work under php 7? Is this a lost cause and maybe I should just install php 5.6 and get on with it?

Thanks-
Lynn Kasdorf


Crispy

unread,
Dec 5, 2019, 2:12:26 AM12/5/19
to Php Object Generator
Hi Lynn,

I haven't tried working with POG in a very long time, but I think it shouldn't be doing anything too strange even for php 7.

try renaming the old style named constructors to the PHP 7  __construct
that may do the trick.

personally, I've moved to Laravel for any new PHP work and it has a nicer ORM built in and is MVC framework. YMMV

Cheers,
-Mark
Reply all
Reply to author
Forward
0 new messages