Alexia / php7mar

PHP 7 Migration Assistant Report (MAR)
GNU General Public License v3.0
797 stars 133 forks source link

Add a check for new operator with reference #17

Closed macbre closed 8 years ago

macbre commented 8 years ago

http://php.net/manual/en/migration70.incompatible.php#migration70.incompatible.other.new-by-ref

Add a check for the following use of new operator which is no longer supported:

<?php
class C {}
$c =& new C;
?>

Parse error: syntax error, unexpected 'new' (T_NEW) in /tmp/test.php on line 3

This code will generate the following entry in the report:

* newOperatorWithReference
 * Line 123: `$c =& new C;`
 * Line 124: `$c =&new C;`
Alexia commented 8 years ago

Looks good to me. Thank you!