This patch removes the so called local variables defined per
file basis for certain editors to properly show tab width, and
similar settings. These are mainly used by Vim and Emacs editors
yet with recent changes the once working definitions don't work
anymore in Vim without custom plugins or additional configuration.
Neither are these settings synced across the PHP code base.
A simpler and better approach is EditorConfig and fixing code
using some code style fixing tools in the future instead.
This patch also removes the so called modelines for Vim. Modelines
allow Vim editor specifically to set some editor configuration such as
syntax highlighting, indentation style and tab width to be set in the
first line or the last 5 lines per file basis. Since the php test
files have syntax highlighting already set in most editors properly and
EditorConfig takes care of the indentation settings, this patch removes
these as well for the Vim 6.0 and newer versions.
With the removal of local variables for certain editors such as
Emacs and Vim, the footer is also probably not needed anymore when
creating extensions using ext_skel.php script.
Additionally, Vim modelines for setting php syntax and some editor
settings has been removed from some *.phpt files. All these are
mostly not relevant for phpt files neither work properly in the
middle of the file.
There are probably some improvements we can do to the SPL
implementation now that __autoload() is gone. In particular having
EG(autoload_func) as a property zend function, rather than a simple
callback probably doesn't make sense.
The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.
In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.
This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.
spl_object_id is a new function returning the object handle,
as a signed integer.
Discussion for this new function is ongoing on php-internals, see
https://marc.info/?t=143835274500003&r=1&w=2
The object id is unique for the lifetime of the object.
When the object is garbage collected,
different objects may & will have the same object id.
- This is also the case for the string generated by spl_object_hash
It is always possible to cast the object handle to a **signed** zend_long
in php 7.2. _zend_object->handle is always of the type `uint32_t`.
(zend_long is 32 bits on 32 bit builds, 64 bits on 64 bit builds)
As of php 7.0, the object id uniquely identifies the object,
there can't be two objects with the same id but different handlers
(See the implementation of spl_object_hash)
Skip the pointless XORing, as discussed in internals.
- It was intended to avoid exposing in-memory addresses.
- The object handle is not a memory address.
- The output of var_dump() includes the object handle(id)
We still keep the same output length, for people who rely on the
return value having a specific format. The handler part will now
simply be always the same (it was the same nearly always anyway).
The motivation behind this change is to avoid breaking
spl_object_hash() and SplObjectStorage if an extension changes the
handlers table of an object. This has come up, for example, in
weakref implementations.