Jump to content

How hard would it be to move it to php8


Nolan81

Recommended Posts

Your teacher is going to grade you on the quality of someone else's library? What?

It doesn't look old. It's not like PHP 8 introduced some incredibly obvious and immensely helpful features that everybody had to stop what they were doing and migrate to using. Like, unless I were to look over it with a fine-toothed comb, I don't think I could tell you whether it was written for PHP 5 or PHP 8.

But no, there aren't really any tools to do what you want automatically. Not that I know of. But the project isn't that large - it should only take, like maybe, 15 minutes if you wanted to "spruce it up" or something.

Link to comment
Share on other sites

One thing to watch for is the stricter variable typing in version 8.

Whereas in earlier versions this would work (the empty string being treated as "0") ...

$a = 5;
$b = '';
echo $a + $b;

in version 8 it throws an error

Quote

PHP Fatal error: Uncaught TypeError: Unsupported operand types: int + string in .....

 

Link to comment
Share on other sites

rector is what chatgpt proposed too.

17 hours ago, requinix said:

Like, unless I were to look over it with a fine-toothed comb, I don't think I could tell you whether it was written for PHP 5 or PHP 8

missing types of the arguments, properties is obvious sign. or code like : = array()

Link to comment
Share on other sites

I looked at the code, and it's fine.  As others said, I'm not sure why it matters, if you are planning to use this as the basis for a project of your own, unless you are planning to try and pass the code off as something you wrote yourself.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.