This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Hi. Yesterday the RFC about "Scalar Type Declarations" has been finally accepted by the PHP developer community. The RFC could be found here: https://wiki.php.net/rfc/scalar_type_hints_v5 The names int, float, string and bool are recognised and allowed as type declarations, and prohibited from use as class/interface/trait names (including with use and class_alias). A new declare() directive is added, strict_types, which takes either 1 or 0. If 1, strict type-checking mode is used for function calls and return statements in the the file. If 0, weak type-checking mode is used. The declare(strict_types=1) directive must be the first statement in a file. If it appears anywhere else in the file it will generate a compiler error. Block mode is also explicitly disallowed (declare(strict_types=1); is the only allowed form). Example: <?php function add(int $a, int $b) { return $a + $b; } var_dump(add(1, 2)); // int(3) // floats are truncated by default var_dump(add(1.5, 2.5)); // int(3) //strings convert if there's a number part var_dump(add("1", "2")); // int(3) ?> The RFC is very detailed. It would be great if Netbeans would support these type declarations in the next version.
Scalar types are just one of many new features in PHP 7 and this issue should be updated in line with the full RFC including scalar types, return types, anonymous classes, reserved key words, spaceship (combined comparison) and more. PHP 7 have been accepted for a while and first release will be in November. I propose the priority gets raised for this issue.
+1 with PHP 7 looming, it would be good to get IDE support
When there will be support php 7?
Any word on this?
@Petah: Try the nightly build! Select PHP5.6 for your project, as there may not be a PHP7 option yet - then, NetBeans should support this feature. (Works for me!) http://bits.netbeans.org/download/trunk/nightly/latest/
This is already fixed in NetBeans 8.2. Thanks.