Php

Asked • 06/05/19

New self vs. new static?

I am converting a PHP 5.3 library to work on PHP 5.2. The main thing standing in my way is the use of late static binding like `return new static($options);` , if I convert this to `return new self($options)` will I get the same results? What is the difference between `new self` and `new static`?

Brandon G.

Hello, has this issue been resolved?
Report

12/04/20

1 Expert Answer

By:

Rui K. answered • 05/05/23

Tutor
New to Wyzant

Seasoned Online Tutor & JavaScript Expert

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.