Jump to content

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.

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 .....

 

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()

1 hour ago, Nolan81 said:

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

Casual code doesn't always use types. And there are people who find "array" to be easier to scan and read than brackets.

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.