-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Typed Properties #1797
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Typed Properties #1797
Changes from 1 commit
Commits
Show all changes
210 commits
Select commit
Hold shift + click to select a range
d5e097e
initial import
krakjoe 3b9c9ff
todos and whatever
krakjoe e016859
remove note
krakjoe 8f74635
exception on uninitialized property access
krakjoe 70e0e4d
be tidy, don't leak, use flags ... other things, probably
krakjoe 5a07809
some tests ...
krakjoe 9303e6d
fixed todo
krakjoe b3e15ca
set flags correctly, remove todo
krakjoe 3dfb8c2
unused var
krakjoe 8c51aac
another test
krakjoe 37e169c
rename function so it makes sense
krakjoe 149cb01
use flags here
krakjoe 52b184e
unexpected
krakjoe bd4368c
more words in error message
krakjoe 0f265a3
inheritance checks
krakjoe 027f0a1
a todo
krakjoe df9556b
nope
krakjoe 64bce1e
some more resolution stuff
krakjoe 3f56cd9
more inheritance stuff
krakjoe 95eed91
fix ast pretty printer
krakjoe ab3e992
refactor a little
krakjoe 48c98ab
add unset test
krakjoe 0b4fb46
abominable reading ahead of the unknown ... in the dark, scarily ....…
krakjoe 4d496ef
some mo tests
krakjoe 95a9e0d
fixes and more stuff
krakjoe 49ea1df
woops
krakjoe b557f8b
don't check private property types during inheritance
krakjoe c957e75
check type on declaration
krakjoe c156399
more tests, check initial value types
krakjoe 861287a
remove todo
krakjoe f7f8c1b
@TazeTSchnitzel rescued me from hell ...
krakjoe ce47372
better error messages
krakjoe 7159da6
cache class entry in property info
krakjoe ef2531c
nothing
krakjoe 414fb83
resolve property type
krakjoe 8095119
add void check during compile
krakjoe f5fdbf1
tidy
krakjoe 8679c7a
allow overflow of int->long, deref container in fetch_obj_w
krakjoe 40b1409
functions are good ?
krakjoe 6077171
more refactor
krakjoe 6e961f0
urm ... we'll want a return value that makes sense
krakjoe a98b4b3
remove todo
krakjoe 0825a9d
...
krakjoe abdde6e
betterness
krakjoe 7d12158
restrict declaration groups
krakjoe 2c3e242
comments
krakjoe e5afe08
nulling these seems like a good idea
krakjoe fb1ef8a
use flags here
krakjoe b4ec5eb
use flags here too
krakjoe 90e18db
test widening, fix uninitialized access check
krakjoe 17f749e
description corrections
krakjoe 476805f
can never be an object at compile time
krakjoe c7306b5
more verify in fetch_obj_r
krakjoe 1fa8106
add tests for obj_read_r coerced value
krakjoe b9f8e85
fix binary assign helper
krakjoe 8dbdbf9
woops
krakjoe 4e8988a
update test desc
krakjoe 3f24be0
delay check for constant/ast during compile
krakjoe 373b2a5
add test for that^
krakjoe d2ab6d2
moar tests
krakjoe fa835f3
refactor switch
krakjoe 1d8a9d7
squish branches
krakjoe fb4f14f
disallow typed static properties, throw core errors for internal clas…
krakjoe 5817fa3
makes no sense
krakjoe d195bce
add tests for inheritance of private props
krakjoe 2beab02
export type from ast ... note that there are still outstanding bugs i…
krakjoe 109ee15
cleanup tests
krakjoe 86ea6ed
fix func arg fetch handler
krakjoe 9a8fb9e
fix mixing typed and untyped properties, add another test for that
krakjoe 0d5d801
reflection changes
krakjoe 29f80f3
the same changes, but nicer
krakjoe 61da1b9
better if this makes sense ... I think
krakjoe 2fde206
ReflectionProperty::hasType
krakjoe 7ed980e
fix trait inheritance
krakjoe 113dc9d
woops
krakjoe db9e574
typed properties need to be undef initial value
krakjoe 87f1a37
only allow widening int to float at runtime
krakjoe 4c7404c
with much regret and sadness ... use strict types directive
krakjoe 8da4950
fix binary assign op surpriseness
krakjoe f3ffc3e
merge
krakjoe d80750e
stuff
krakjoe 37fe31f
Merge branch 'master' of https://github.com/php/php-src into typed-pr…
krakjoe 3628c34
an woops
krakjoe 72e330a
lift unset restriction, possibly temporarily while we argue about stu…
krakjoe 90fde77
add test
krakjoe 8ce9014
tidy up vm stuff
krakjoe d2df329
some consistency
krakjoe d01e02b
this kind of type verification only happens at runtime
krakjoe e3e46f0
info always available
krakjoe 5037a74
improve error message to distinguish between arg by reference and by …
krakjoe b2d5f55
not needed
krakjoe 5e57cda
check in rw fetch, not sure about this ?
krakjoe 896a4a6
just make travis run again
krakjoe 449ca5d
Merge branch 'master' of https://github.com/php/php-src into typed-pr…
krakjoe baa0997
the next opline always exists
krakjoe 8886795
require guard here too
krakjoe 658fc85
delay fetching iterator until after guard
krakjoe 1fd296d
--indentation
krakjoe eed867a
fix return by ref
krakjoe fced030
do not allow send ref
krakjoe 1dfbed4
add yield by reference guard
krakjoe b1543e5
guard add array element
krakjoe 3a057cb
use api for stuff ... doh
krakjoe bc450bb
inheritance fixes
krakjoe 8a8d97a
woops
krakjoe be570b0
separate proeprty type verification and error routine, fix display of…
krakjoe f1e0152
Merge branch 'master' of https://github.com/php/php-src into typed-pr…
krakjoe 46bffb2
Merge branch 'master' of https://github.com/php/php-src into typed-pr…
krakjoe 9fc0b75
Merge branch 'master' of https://github.com/php/php-src into typed-pr…
krakjoe 4f1b2e1
better detection
krakjoe e48ecd8
caches and things ... Thanks Dmitry :)
krakjoe efe506a
fix foreach, possibly ...
krakjoe c6eb6d2
fix foreach
krakjoe cce2414
change decl groups
krakjoe 8f3ad60
overflow consistency
krakjoe f13b0a3
moar consistent ... even if strange
krakjoe dd6d5ad
make var_dump more acceptable
krakjoe a99e7d1
better
krakjoe a684a36
Merge branch 'master' of https://github.com/php/php-src into typed-pr…
krakjoe e7d8aa7
haaaaaands
krakjoe 88ff051
add overflowingness test
krakjoe 7e02f50
make travis run
krakjoe 7edbbae
fix test [ci skip]
krakjoe 26e1afb
fix memory error in std_write_property
krakjoe a2d6d5b
fix another possible memory error
krakjoe 4674286
better guard here and use _ex to avoid ever reading type info, we kno…
krakjoe ff56cd6
don't perform check on inline properties on read, only for magic
krakjoe 2181b0e
use more efficient macro when possible
krakjoe e8bac36
fix test case given by dmitry ...
krakjoe 335ca97
only need null check here
krakjoe 239216a
use more efficient stuff here
krakjoe 6f57c44
this was checked on write too
krakjoe e62942a
safety for non standard objects, remove pointless check
krakjoe 48d5aec
some more improvements ... haaaands
krakjoe 3f8430e
use api stuff here
krakjoe f391d86
catch more cases here
krakjoe 304ff49
nothin to see here ...
krakjoe 2a5daa7
improve performance
krakjoe 9461e37
cold error path
krakjoe fcaf14a
optimize all the things, thanks @bwoebi
krakjoe ecfb1e3
more perf stuff
krakjoe f284596
Merge branch 'master' of https://github.com/php/php-src into typed-pr…
krakjoe a3e98d7
dtor correct thing
krakjoe 19de3fc
dtor tmp
krakjoe fce9549
check correct variable
krakjoe 47003bd
Optimize & fix value reassign
bwoebi 9282b82
Easy optimization: constant assignment to objects will always succeed…
bwoebi 403dabf
Optimize property fetching and fix edge cases with __get()
bwoebi 6a0e3c9
Disallow functions to set references and bad types
bwoebi 7eeda09
missing colons
krakjoe c2712a5
Merge branch 'master' into typed-properties
dstogov ce442f9
Fixed white-spaces
dstogov 25ed1f2
Revert insignificant formatting changes to minimize the patch against…
dstogov 758076a
Fix passed zval reassignments (opcache.protect_memory=1)
bwoebi e5f9ada
Respect also immutable values
bwoebi 88def3f
Added tests
dstogov 4b28b0d
Added test (error message should be the same independently of called …
dstogov 2ce08ca
Fixed Zend/tests/type_declarations/typed_properties_044.phpt (error m…
dstogov 4705b9f
Fixed memory leaks
dstogov 62b6bef
Avoid type check for dynamic properties
dstogov d27efdb
Removed "safety" code for non standard zend objects.
dstogov 68bb52e
Fixed memory leaks
dstogov a1e3ea3
Fixed test (NULL is no compatible with "int" and should produce a error)
dstogov 4aae938
Get rid of zend_verify_scalar_property_type(), use common zend_verify…
dstogov 59b8a85
Optimized zend_verify_property_type()
dstogov d46584f
Avoid type check for dynamic properties
dstogov ff19dec
Added support for nullable typed properties
dstogov 7d0654e
Added test
dstogov 852606c
Fix further invalid source zval overwrites
bwoebi 142e1da
Merge branch 'master' into typed-properties
dstogov 03861bd
Reverted incomplete fix
dstogov be071cd
Fixed test
dstogov c992fcf
A better to fix for source zval separation on type conversion caused …
dstogov f4b4051
Changed behavior of uninitialized nullable properties (accoding to co…
dstogov e657bf8
Revert useless changes
dstogov d46695d
Removed useless check (references are never fetched using FETCH_OBJ_RW)
dstogov a53b8ac
Removed duplicate code
dstogov d248c27
Added support for nullavle types in AST pretty printer
dstogov e1017f9
Revert useless change
dstogov 291d431
Added test (memory leaks)
dstogov 40aa6c2
"string" mat be also a valid "callable"
dstogov 3143597
Removed unused function and macro
dstogov 4506a70
Optimization
dstogov 05dd2e4
Removed unused zend_object_fetch_property_type_info() and renamed zen…
dstogov 023df77
Fixed wrong exception when passing element of typed property by refer…
dstogov 56e2aaa
Optimisation
dstogov d7f313e
Added test (failed with valgrind)
dstogov 892994d
Added test (failed with valgrind)
dstogov b0dcf0c
Fixed memory leak
dstogov 2019f66
Check type after constant resolution
dstogov c304c6b
Support for type checks of named constants in property default values.
dstogov b2cebf6
Fixed memory leaks
dstogov 8bc2078
Faster +=/++/--
dstogov 26bf822
Merge branch 'master' into typed-properties
dstogov 865686f
Fixed ZTS compatibility
dstogov bf875fb
Fixed compilation warning
dstogov fc41cdc
fixed white-spaces
dstogov 8beea3d
Optimization
dstogov 13c86d9
Cleanup ext/reflection changes
dstogov 697b1b1
Moved BG(unserialize_refs) into php_unserialize_data_t
dstogov c5e45ff
Keep GCC from incorrect over-optimisation
dstogov 6bb1fa9
Removed useles code (default value should be already properly set in …
dstogov 5811e86
Don't mess NULL and UNDEF default value back and force. Set proper va…
dstogov 037da58
Remove duplicate checks
dstogov 03e7112
Fixed incorrect argument types
dstogov cc19dc5
Remove bad checks for simple property inheritance
bwoebi 3bbe52d
Merge branch 'master' of https://github.com/php/php-src into typed-pr…
krakjoe de84f50
changes prompted by review
krakjoe 71cda1b
make consistent with RFC (nullables)
krakjoe 8eec27f
fix inheritance error
krakjoe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
cache class entry in property info
- Loading branch information
commit 7159da698942f6d42b2fab9a79f0a453a36d04d7
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't these be a union? You can either have a scalar/array type or a class entry, not both.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, they shouldn't.
On 10 Mar 2016 15:42, "Guilherme Blanco" notifications@github.com wrote:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be possible to merge all 3 fields into single union using "bit stealling" technique, but this may be done separately and uniformly for all kind of type hints.