Need help understanding code

I am trying to figure out why an old PHP code doesn’t work as expected. The following line puzzles me:

$this = new $class($i!=$step);

In the above code,


So does the line mean:

$this = new Step;

But there is no class Step, only Step1, Step2, etc.

I’m a little confused. Are you asking why the code isn’t working when you think it should, or why the code is working when you think it shouldn’t?

And to answer your question either way, we’ll probably need to see more of the actual code. The code you’ve shown us would not work, and that’s to be expected.

I am just asking what’s going on on that line of code (I mentioned what variables contain).

And yes, it actually works. I was surprised too.

It’s PHP 4 btw.

I made a mistake. Here is the correction:


For some reason, class Step4 is created by this line:

$this = new $class($i!=$step);

Could the concatenation (‘.’) operator be skipped in PHP 4? Has anybody seen anything like this?