# [RFC] [VOTE] Preloading

- Thread: https://externals.io/message/103421
- Original archive: https://news-web.php.net/php.internals/103421
- Started by Dmitry Stogov on 2018-11-06T10:04:47+00:00
- Messages: 8
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #103421 — Dmitry Stogov — 2018-11-06T10:04:47+00:00

URL: https://externals.io/message/103421#103421

Hi internals,


The preloading RFC is turned into voting state.


https://wiki.php.net/rfc/preload


Many thanks to Anatol, MZPERX and Xinchen for testing.

I hope, most of the implementation issues should be fixed now.


Thanks. Dmitry.

---

## #103422 — Dan Ackroyd — 2018-11-06T11:00:50+00:00

URL: https://externals.io/message/103421#103422 · In reply to: #103421

Hi Dmitry,

>
> Hi internals,
>
>
> The preloading RFC is turned into voting state.

Apologies if it's been asked before but from:

> Only classes without unresolved parent, interfaces, traits and constant
> values may be preloaded. If a class doesn't satisfy to this condition, ...

Is it possible to inspect which classes have been successfully
preloaded, and/or which classes have failed to be preloaded due to
violation of the appropriate conditions?

cheers
Dan

---

## #103423 — Christoph M. Becker — 2018-11-06T11:35:28+00:00

URL: https://externals.io/message/103421#103423 · In reply to: #103422

> 
>
> > […]
> 
> Apologies if it's been asked before but from:
> 
> > […]
> 
> Is it possible to inspect which classes have been successfully
> preloaded, and/or which classes have failed to be preloaded due to
> violation of the appropriate conditions?

The RFC states:

| opcache_get_status is extended to provide information about preloaded
| functions, classes and scripts under the “preload_statistics” index.

-- 
Christoph M. Becker

---

## #103424 — Dmitry Stogov — 2018-11-06T12:10:53+00:00

URL: https://externals.io/message/103421#103424 · In reply to: #103423

> 
>
> > […]
> The RFC states:
>
> | opcache_get_status is extended to provide information about preloaded
> | functions, classes and scripts under the “preload_statistics” index.

Right, if I remember properly, this was Rasmus idea.

$ sapi/cli/php -r 'var_dump(opcache_get_status());'

array(9) {
   ...
   ["preload_statistics"]=>
   array(4) {
     ["memory_consumption"]=>
     int(912672)
     ["functions"]=>
     array(?) {
       [0]=>
       string(8) "_preload"
       ...
     }
     ["classes"]=>
     array(?) {
       [0]=>
       string(38) "Zend_Controller_Action_Helper_Abstract"
       ...
     }
     array(?) {
       [0]=>
       string(46) "/home/dmitry/php/etc/preload.php"
       ...
     }
   }
   ...
}

Thanks. Dmitry.

---

## #103425 — Levi Morrison — 2018-11-06T16:07:45+00:00

URL: https://externals.io/message/103421#103425 · In reply to: #103421

>
> Hi internals,
>
>
> The preloading RFC is turned into voting state.
>
>
> https://wiki.php.net/rfc/preload
>
>
> Many thanks to Anatol, MZPERX and Xinchen for testing.
>
> I hope, most of the implementation issues should be fixed now.
>
>
> Thanks. Dmitry.
>

I am cautiously optimistic about this RFC. I hope some of the Future
Scope items can be implemented soon.

---

## #103429 — guilhermeblanco@gmail.com — 2018-11-07T15:14:11+00:00

URL: https://externals.io/message/103421#103429 · In reply to: #103425

Hi,

Besides the yet-another naming convention, I'm quite optimistic about this
RFC.
Now on the convention, is there any reason why single underscore (_) is
used instead of double underscores (__)? We already have __autoload,
__sleep, __toString, __wakeup, etc.

Regards,



> 
> > […]
>
> I am cautiously optimistic about this RFC. I hope some of the Future
> Scope items can be implemented soon.
>
> --
> 
> 
>
>

-- 
Guilherme Blanco
Chief Architect at Statflo Inc.

---

## #103430 — Benjamin Morel — 2018-11-07T15:26:55+00:00

URL: https://externals.io/message/103421#103430 · In reply to: #103429

>
> Now on the convention, is there any reason why single underscore (_) is
> used instead of double underscores (__)?


Are you talking about _preload()? I guess this is just an example userland
code in the RFC, not a new internal or magic method.

---

## #103431 — Christoph M. Becker — 2018-11-07T15:30:37+00:00

URL: https://externals.io/message/103421#103431 · In reply to: #103429

> Now on the convention, is there any reason why single underscore (_) is
> used instead of double underscores (__)? We already have __autoload,
> __sleep, __toString, __wakeup, etc.

There is no convention at all.  The ini directive opcache.preload allows
to specify a PHP script which will be evaluated.  Period.

-- 
Christoph M. Becker
