79322622

Date: 2025-01-02 02:03:06
Score: 1.5
Natty:
Report link

One that just bit me migrating an old codebase....

$x=$obj->$classes[0]; parses as intended in 5.6--getting a class name from $classes[0]--but 7.4 tries to use just $classes and then errors out on the [0] literal. So....

$x=$obj->{$classes[0]}; curly braces save the day to make 7.4 happy.

Reasons:
  • Low length (0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Roger Krueger