[[pdt]]
== PHP

The Eclipse Neon release includes significant improvements in
stability (including fixes for more than 100 bugs) and a lot of new
functionality for PHP developers.

=== PHP Language

Eclipse Neon provides better error messages for unsupported PHP 
versions (especially for legacy versions).

[[pdt-php7]]
==== PHP 7

PHP 7 is the default version for new workspaces.

image::images/Pdt37_php7.jpg[]

Final support for PHP 7 scalar type declarations.

image::images/Pdt40_scalar.png[]

The syntax highlighter now fully supports PHP 7 context sensitive
keywords.

image::images/Pdt40_context_sensitive.png[]

=== Editors

==== Code Assist

The PHP validator identifies non abstract methods without body.

image::images/Pdt40_no_body.png[]

Inappropriate use of multiple access modifiers (eg. `public` `private`
functions)

image::images/Pdt40_multiple_access_modifiers.png[]

The validator no longer analyzes PHP comments (except in _PHPDoc_ comments).

image::images/Pdt40_use.png[]

Improved Code Assist for `@param`, `@return`, and `@throws` tags
inside _PHPDoc_

image:images/Pdt37_ca1.png[] image:images/Pdt37_ca2.png[]

The PHP indexer is significantly faster than in previous versions. 
The UI remains responsive when indexing is in progress.

Better task tags (e.g. `@todo`) detection

image::images/Pdt40_task_tags.png[]

Methods and functions are visible as `void` only if they do not have
`return` and `yield` statements. The otherwise have the declared 
return type or `mixed`.

image::images/Pdt40_return_types.png[]

Simple types (`int`, `bool`, `string`, ...) are included in the 
suggestions for for PHP >= 7 function return types.

image::images/Pdt40_return_sugestion.png[]

===== More Code Assist

* Improved Code Assist for unfinished class and method bodies;
* Improved support around `@inheritdoc` (coloring and code assist).

==== Highlighting

More semantic highlighters are enabled by default, including class, 
deprecation, and constants.

image::images/Pdt40_default_highlighters.png[]

Improved highlighting for `array` type.

image::images/Pdt40_array_highlight.png[]

Added support for `instanceof` and `insteadof` in class semantic
highlighter.

image::images/Pdt40_class_instanceof.png[]

Assign to local quick assist (`pass:[ctrl/cmd + 2 + L]`)

image::images/Pdt40_assign_to_local.png[]

Function / method return types are available in Content Assist
proposals

image::images/Pdt40_ca_return_types.png[]

Content Assist now supports colored labels

image::images/Pdt40_colored_labels.png[]

==== PHP Editor Commands

Buttons have been added to the editor toolbar to enable/disable _Word wrap_, 
_Block selection_, and _Show white space characters_.

image::images/Pdt40_editor_actions.png[]

==== More PHP Editor Improvemvents

* Improved code assist performance for files with many assignments;
* General performance improvements for _PHPDoc_ generation
* Smart parenthesis works correctly inside closures
* `abstract` keyword is no longer proposed inside method body
* Deprecated highlighting is shown even if class in same namespace
* Content assist and hover tooltips shows function / method return types
* Improved deprecation highlighter support for inherited members

==== IDE Integration

Integration with the _Project Explorer_ view has been improved, 
including dedicated support for PHP Project elements and specific actions,
and support for traits when the "group by namespace" option is selected.

PHP Language Libraries have PHP Version badge

image::images/Pdt40_php_version_badge.png[]

"Add PHP support..." no longer visible in PHP-enabled projects (i.e. when
it is unnecessary).

PHP _Quick Fixes_ are available in _Problems View_.

image::images/Pdt37_quickfix.png[]

[[pdt-debugging]]
=== PHP Debugging

Eclipse Neon includes numerous bug fixes and improvements in the PHP
Debugging. 

==== Exception Breakpoints 

Support for PHP exception breakpoints

image::images/Pdt-ExceptionBP.png[]

==== More Debugging

* OSX support improvements
* Improvements in debugger variables support
* No longer display outdated values
* Fix ignored breakpoints
* Added support for class statics inside namespace
* Remove PDT "Parameter Stack" view (the _Variables_ view renders this outdated _Parameter Stack_ view as redundant and useless).\
* Breakpoints work with linked resources
* Xdebug debugging via SSH tunnel