php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70650 Wrong docblock assignment
Submitted: 2015-10-06 14:18 UTC Modified: 2015-10-06 20:33 UTC
From: marcio@php.net Assigned: marcio (profile)
Status: Closed Package: Reflection related
PHP Version: 7.0.0RC4 OS:
Private report: No CVE-ID: None
 [2015-10-06 14:18 UTC] marcio@php.net
Description:
------------
The parser/lexer seems to be collecting wrong docblocks on some edge cases. Live example https://3v4l.org/b4Jaq

Test script:
---------------
<?php

class X {
    /**
     * @docblock1
     */
    public
        $x = "x",
        $y = 'y',
        /** @docblock2 */
        $z = 'z'
    ;
}

$reflection = new ReflectionProperty('\X', 'x');
echo 'X::x', PHP_EOL;
var_dump($reflection->getDocComment());

$reflection = new ReflectionProperty('\X', 'y');
echo 'X::y', PHP_EOL;
var_dump($reflection->getDocComment());

$reflection = new ReflectionProperty('\X', 'z');
echo 'X::z', PHP_EOL;
var_dump($reflection->getDocComment());


Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-10-06 20:33 UTC] marcio@php.net
-Assigned To: +Assigned To: marcio
 [2015-10-07 14:27 UTC] nikic@php.net
Automatic comment on behalf of marcio3w@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ddb6d7801e5dfc2f196b549b8ad51376cdc1bc90
Log: Fix bug #70650
 [2015-10-07 14:27 UTC] nikic@php.net
-Status: Assigned +Status: Closed
 [2015-10-13 10:12 UTC] ab@php.net
Automatic comment on behalf of marcio3w@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ddb6d7801e5dfc2f196b549b8ad51376cdc1bc90
Log: Fix bug #70650
 [2016-07-20 11:36 UTC] davey@php.net
Automatic comment on behalf of marcio3w@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ddb6d7801e5dfc2f196b549b8ad51376cdc1bc90
Log: Fix bug #70650
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 08:01:29 2024 UTC