DDC-2107: Debug::dump lists the wrong access level for some attributes #2653

Open
opened 2026-01-22 13:59:23 +01:00 by admin · 0 comments
Owner

Originally created by @doctrinebot on GitHub (Oct 29, 2012).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user gzankevich:

\Doctrine\Common\Util\Debug::dump() shows the wrong access level for some attributes. The below code reproduces the bug:

\Doctrine\Common\Util\Debug::dump(
    new \Doctrine\ORM\Query\Expr\Select()
);

\Doctrine\ORM\Query\Expr\Select and \Doctrine\ORM\Query\Expr\Base define a bunch of protected class attributes, however, the Dump method fails to indicate their correct access level.

Expected result:

object(stdClass)[740]
  public '*_CLASS_*' => string 'Doctrine\ORM\Query\Expr\Select' (length=30)
  protected 'preSeparator' => string '' (length=0)
  protected 'postSeparator' => string '' (length=0)
  protected 'allowedClasses' => 
    array (size=1)
      0 => string 'Doctrine\ORM\Query\Expr\Func' (length=28)
  protected 'separator' => string ', ' (length=2)
  protected 'parts' => 
    array (size=0)
      empty

Actual result:

object(stdClass)[740]
  public '*_CLASS_*' => string 'Doctrine\ORM\Query\Expr\Select' (length=30)
  public 'preSeparator' => string '' (length=0)
  public 'postSeparator' => string '' (length=0)
  public 'allowedClasses' => 
    array (size=1)
      0 => string 'Doctrine\ORM\Query\Expr\Func' (length=28)
  public 'separator' => string ', ' (length=2)
  public 'parts' => 
    array (size=0)
      empty
Originally created by @doctrinebot on GitHub (Oct 29, 2012). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user gzankevich: \Doctrine\Common\Util\Debug::dump() shows the wrong access level for some attributes. The below code reproduces the bug: ``` \Doctrine\Common\Util\Debug::dump( new \Doctrine\ORM\Query\Expr\Select() ); ``` \Doctrine\ORM\Query\Expr\Select and \Doctrine\ORM\Query\Expr\Base define a bunch of protected class attributes, however, the Dump method fails to indicate their correct access level. Expected result: ``` object(stdClass)[740] public '*_CLASS_*' => string 'Doctrine\ORM\Query\Expr\Select' (length=30) protected 'preSeparator' => string '' (length=0) protected 'postSeparator' => string '' (length=0) protected 'allowedClasses' => array (size=1) 0 => string 'Doctrine\ORM\Query\Expr\Func' (length=28) protected 'separator' => string ', ' (length=2) protected 'parts' => array (size=0) empty ``` Actual result: ``` object(stdClass)[740] public '*_CLASS_*' => string 'Doctrine\ORM\Query\Expr\Select' (length=30) public 'preSeparator' => string '' (length=0) public 'postSeparator' => string '' (length=0) public 'allowedClasses' => array (size=1) 0 => string 'Doctrine\ORM\Query\Expr\Func' (length=28) public 'separator' => string ', ' (length=2) public 'parts' => array (size=0) empty ```
admin added the Improvement label 2026-01-22 13:59:23 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#2653