[PHP-BUG] Bug #54361 [NEW]: Wrong line number in fatal error for bad namespace reference

2011-03-23 Thread robert at typo3 dot org
From: 
Operating system: MacOSX
PHP version:  5.3.6
Package:  Class/Object related
Bug Type: Bug
Bug description:Wrong line number in fatal error for bad namespace reference

Description:

When referring to a not existing namespace / class in a variable assignment
of a 

class (see code example), a fatal error is (correctly) triggered. 



However, the error does not give a hint at where the problem actually lies
but 

refers to the location where the faulty class is instantiated.

Test script:
---
namespace FooNamespace {

class FooClass {

const MYCONST = 1;

}

}



namespace BarNamespace {



// this would prevent the fatal error:

#   use FooNamespace as Foo;



class BarClass {

// the error is triggered by this line:

protected $variable = Foo\FooClass::MYCONST;

}

}



namespace {

// Fatal error: Class 'BarNamespace\Foo\FooClass' not found 
in the
following line:

$bar = new \BarNamespace\BarClass();

}

Expected result:

Fatal error: Class 'BarNamespace\Foo\FooClass' not found in test.php on
line line 

number of the variable assignment in BarClass

Actual result:
--
Fatal error: Class 'BarNamespace\Foo\FooClass' not found in test.php on
line line 

number of new statement

-- 
Edit bug report at http://bugs.php.net/bug.php?id=54361edit=1
-- 
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=54361r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=54361r=trysnapshot53
Try a snapshot (trunk):  
http://bugs.php.net/fix.php?id=54361r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=54361r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=54361r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=54361r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=54361r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=54361r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=54361r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=54361r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=54361r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=54361r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=54361r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=54361r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=54361r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=54361r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=54361r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=54361r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=54361r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=54361r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=54361r=mysqlcfg



#47671 [NEW]: Cloning of SplObjectStorage is undefined

2009-03-16 Thread robert at typo3 dot org
From: robert at typo3 dot org
Operating system: Mac OS 10.5.6
PHP version:  5.3.0beta1
PHP Bug Type: SPL related
Bug description:  Cloning of SplObjectStorage is undefined

Description:

After cloning an instance of SplObjectStorage the number of objects 
which can be retrieved with count() is very high and foreach() causes a 
segfault.

Reproduce code:
---
class Foo {}

$storageA = new \SplObjectStorage();
$storageA-attach(new \Foo);
$storageA-attach(new \Foo);

echo (Count storage A:  . count($storageA));
foreach ($storageA as $object) {
echo ' x ';
}

$storageB = clone $storageA;
echo (Count storage B:  . count($storageB));
foreach ($storageB as $object) {
echo ' x ';
}


Expected result:

Count storage A: 2 x x Count storage B: 2 x x

Actual result:
--
Count storage A: 2 x x Count storage B: 1953394499

-- 
Edit bug report at http://bugs.php.net/?id=47671edit=1
-- 
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=47671r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=47671r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=47671r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=47671r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=47671r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=47671r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=47671r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=47671r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=47671r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=47671r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=47671r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=47671r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=47671r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=47671r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=47671r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=47671r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=47671r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=47671r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=47671r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=47671r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=47671r=mysqlcfg



#41482 [NEW]: get_declared_classes() returns non-existing classes

2007-05-24 Thread robert at typo3 dot org
From: robert at typo3 dot org
Operating system: Mac OSX
PHP version:  6CVS-2007-05-24 (snap)
PHP Bug Type: Unknown/Other Function
Bug description:  get_declared_classes() returns non-existing classes

Description:

A call to get_declared_classes() returns, among the really defined
classes, a few class names which look like arbitrary unicode strings.
However, at least one of these classes don't exist and class_exists()
returns false.

My configure command:

'./configure' '--prefix=/opt/local' '--enable-bcmath' '--enable-calendar'
'--enable-dba' '--enable-dbx' '--enable-exif' '--enable-filepro'
'--enable-ftp' '--enable-gd-native-ttf' '--enable-soap'
'--enable-sqlite-utf8' '--enable-trans-sid' '--enable-wddx'
'--infodir=/opt/local/share/info'
'--with-apxs2=/opt/local/apache2/bin/apxs' '--with-curl=/opt/local'
'--with-freetype-dir=/opt/local' '--with-gettext=/opt/local'
'--with-iconv=/opt/local' '--with-icu-dir=/opt/local' '--with-iodbc=/usr'
'--with-jpeg-dir=/opt/local' '--with-kerberos=/usr' '--with-ldap=/usr'
'--with-libxml-dir=/opt/local' '--with-mcrypt=/opt/local'
'--with-openssl=/opt/local' '--with-pcre-regex=/opt/local'
'--with-pdo-sqlite=/opt/local' '--with-png-dir=/opt/local' '--with-sqlite'
'--with-xmlrpc' '--with-xsl=/opt/local' '--with-zlib=/opt/local'
'--without-pear' '--mandir=/opt/local/share/man'
'--with-config-file-path=/opt/local/etc' '--with-expat-dir=/opt/local'
'--with-mysqli=/opt/local/bin/mysql_config5'

Reproduce code:
---
class myClass {
}

var_dump(get_declared_classes());

foreach(get_declared_classes() as $className) {
if (!class_exists($className)) echo ($className does not exist.\n);
}


Expected result:

array(123) {
  [0]=
  unicode(8) stdClass
  [1]=
  unicode(9) Exception
  [2]=
  unicode(14) ErrorException
  [3]=
  unicode(26) UnicodeConversionException
  [4]=
  unicode(11) LibXMLError
  [5]=
  unicode(13) XSLTProcessor
  [6]=
  unicode(9) XMLWriter
  [7]=
  unicode(12) DOMException
  [8]=
  unicode(13) DOMStringList
  [9]=
  unicode(11) DOMNameList
  [10]=
  unicode(21) DOMImplementationList
  [11]=
  unicode(23) DOMImplementationSource
  [12]=
  unicode(17) DOMImplementation
  [13]=
  unicode(7) DOMNode
  [14]=
  unicode(16) DOMNameSpaceNode
  [15]=
  unicode(19) DOMDocumentFragment
  [16]=
  unicode(11) DOMDocument
  [17]=
  unicode(11) DOMNodeList
  [18]=
  unicode(15) DOMNamedNodeMap
  [19]=
  unicode(16) DOMCharacterData
  [20]=
  unicode(7) DOMAttr
  [21]=
  unicode(10) DOMElement
  [22]=
  unicode(7) DOMText
  [23]=
  unicode(10) DOMComment
  [24]=
  unicode(11) DOMTypeinfo
  [25]=
  unicode(18) DOMUserDataHandler
  [26]=
  unicode(11) DOMDomError
  [27]=
  unicode(15) DOMErrorHandler
  [28]=
  unicode(10) DOMLocator
  [29]=
  unicode(16) DOMConfiguration
  [30]=
  unicode(15) DOMCdataSection
  [31]=
  unicode(15) DOMDocumentType
  [32]=
  unicode(11) DOMNotation
  [33]=
  unicode(9) DOMEntity
  [34]=
  unicode(18) DOMEntityReference
  [35]=
  unicode(24) DOMProcessingInstruction
  [36]=
  unicode(15) DOMStringExtend
  [37]=
  unicode(8) DOMXPath
  [38]=
  unicode(9) XMLReader
  [39]=
  unicode(12) TextIterator
  [40]=
  unicode(19) ReverseTextIterator
  [41]=
  unicode(8) Collator
  [42]=
  unicode(1) U
  [43]=
  unicode(16) SimpleXMLElement
  [44]=
  unicode(25) RecursiveIteratorIterator
  [45]=
  unicode(16) IteratorIterator
  [46]=
  unicode(14) FilterIterator
  [47]=
  unicode(23) RecursiveFilterIterator
  [48]=
  unicode(14) ParentIterator
  [49]=
  unicode(13) LimitIterator
  [50]=
  unicode(15) CachingIterator
  [51]=
  unicode(24) RecursiveCachingIterator
  [52]=
  unicode(16) NoRewindIterator
  [53]=
  unicode(14) AppendIterator
  [54]=
  unicode(16) InfiniteIterator
  [55]=
  unicode(13) RegexIterator
  [56]=
  unicode(22) RecursiveRegexIterator
  [57]=
  unicode(13) EmptyIterator
  [58]=
  unicode(11) ArrayObject
  [59]=
  unicode(13) ArrayIterator
  [60]=
  unicode(22) RecursiveArrayIterator
  [61]=
  unicode(11) SplFileInfo
  [62]=
  unicode(17) DirectoryIterator
  [63]=
  unicode(26) RecursiveDirectoryIterator
  [64]=
  unicode(13) SplFileObject
  [65]=
  unicode(17) SplTempFileObject
  [66]=
  unicode(17) SimpleXMLIterator
  [67]=
  unicode(14) LogicException
  [68]=
  unicode(24) BadFunctionCallException
  [69]=
  unicode(22) BadMethodCallException
  [70]=
  unicode(15) DomainException
  [71]=
  unicode(24) InvalidArgumentException
  [72]=
  unicode(15) LengthException
  [73]=
  unicode(19) OutOfRangeException
  [74]=
  unicode(16) RuntimeException
  [75]=
  unicode(20) OutOfBoundsException
  [76]=
  unicode(17) OverflowException
  [77]=
  unicode(14) RangeException
  [78]=
  unicode(18) UnderflowException
  [79]=
  unicode(24) UnexpectedValueException
  [80]=
  unicode(16) SplObjectStorage
  [81]=
  unicode(12) PDOException
  [82]=
  unicode(3) PDO
  [83]=
  unicode(12) PDOStatement
  [84]=
  unicode(6) PDORow
  [85]=
  unicode(10) SoapClient
  [86]=
  unicode(7) SoapVar
  [87

#41482 [Opn]: get_declared_classes() returns non-existing classes

2007-05-24 Thread robert at typo3 dot org
 ID:   41482
 User updated by:  robert at typo3 dot org
 Reported By:  robert at typo3 dot org
 Status:   Open
 Bug Type: Unknown/Other Function
 Operating System: Mac OSX
 PHP Version:  6CVS-2007-05-24 (snap)
 New Comment:

Sorry, for some reason the var_dump array output in the expected result
was pasted in twice. I expect the second array of course, that one
without the special character class names.


Previous Comments:


[2007-05-24 07:25:49] robert at typo3 dot org

Description:

A call to get_declared_classes() returns, among the really defined
classes, a few class names which look like arbitrary unicode strings.
However, at least one of these classes don't exist and class_exists()
returns false.

My configure command:

'./configure' '--prefix=/opt/local' '--enable-bcmath'
'--enable-calendar' '--enable-dba' '--enable-dbx' '--enable-exif'
'--enable-filepro' '--enable-ftp' '--enable-gd-native-ttf'
'--enable-soap' '--enable-sqlite-utf8' '--enable-trans-sid'
'--enable-wddx' '--infodir=/opt/local/share/info'
'--with-apxs2=/opt/local/apache2/bin/apxs' '--with-curl=/opt/local'
'--with-freetype-dir=/opt/local' '--with-gettext=/opt/local'
'--with-iconv=/opt/local' '--with-icu-dir=/opt/local'
'--with-iodbc=/usr' '--with-jpeg-dir=/opt/local' '--with-kerberos=/usr'
'--with-ldap=/usr' '--with-libxml-dir=/opt/local'
'--with-mcrypt=/opt/local' '--with-openssl=/opt/local'
'--with-pcre-regex=/opt/local' '--with-pdo-sqlite=/opt/local'
'--with-png-dir=/opt/local' '--with-sqlite' '--with-xmlrpc'
'--with-xsl=/opt/local' '--with-zlib=/opt/local' '--without-pear'
'--mandir=/opt/local/share/man' '--with-config-file-path=/opt/local/etc'
'--with-expat-dir=/opt/local'
'--with-mysqli=/opt/local/bin/mysql_config5'

Reproduce code:
---
class myClass {
}

var_dump(get_declared_classes());

foreach(get_declared_classes() as $className) {
if (!class_exists($className)) echo ($className does not exist.\n);
}


Expected result:

array(123) {
  [0]=
  unicode(8) stdClass
  [1]=
  unicode(9) Exception
  [2]=
  unicode(14) ErrorException
  [3]=
  unicode(26) UnicodeConversionException
  [4]=
  unicode(11) LibXMLError
  [5]=
  unicode(13) XSLTProcessor
  [6]=
  unicode(9) XMLWriter
  [7]=
  unicode(12) DOMException
  [8]=
  unicode(13) DOMStringList
  [9]=
  unicode(11) DOMNameList
  [10]=
  unicode(21) DOMImplementationList
  [11]=
  unicode(23) DOMImplementationSource
  [12]=
  unicode(17) DOMImplementation
  [13]=
  unicode(7) DOMNode
  [14]=
  unicode(16) DOMNameSpaceNode
  [15]=
  unicode(19) DOMDocumentFragment
  [16]=
  unicode(11) DOMDocument
  [17]=
  unicode(11) DOMNodeList
  [18]=
  unicode(15) DOMNamedNodeMap
  [19]=
  unicode(16) DOMCharacterData
  [20]=
  unicode(7) DOMAttr
  [21]=
  unicode(10) DOMElement
  [22]=
  unicode(7) DOMText
  [23]=
  unicode(10) DOMComment
  [24]=
  unicode(11) DOMTypeinfo
  [25]=
  unicode(18) DOMUserDataHandler
  [26]=
  unicode(11) DOMDomError
  [27]=
  unicode(15) DOMErrorHandler
  [28]=
  unicode(10) DOMLocator
  [29]=
  unicode(16) DOMConfiguration
  [30]=
  unicode(15) DOMCdataSection
  [31]=
  unicode(15) DOMDocumentType
  [32]=
  unicode(11) DOMNotation
  [33]=
  unicode(9) DOMEntity
  [34]=
  unicode(18) DOMEntityReference
  [35]=
  unicode(24) DOMProcessingInstruction
  [36]=
  unicode(15) DOMStringExtend
  [37]=
  unicode(8) DOMXPath
  [38]=
  unicode(9) XMLReader
  [39]=
  unicode(12) TextIterator
  [40]=
  unicode(19) ReverseTextIterator
  [41]=
  unicode(8) Collator
  [42]=
  unicode(1) U
  [43]=
  unicode(16) SimpleXMLElement
  [44]=
  unicode(25) RecursiveIteratorIterator
  [45]=
  unicode(16) IteratorIterator
  [46]=
  unicode(14) FilterIterator
  [47]=
  unicode(23) RecursiveFilterIterator
  [48]=
  unicode(14) ParentIterator
  [49]=
  unicode(13) LimitIterator
  [50]=
  unicode(15) CachingIterator
  [51]=
  unicode(24) RecursiveCachingIterator
  [52]=
  unicode(16) NoRewindIterator
  [53]=
  unicode(14) AppendIterator
  [54]=
  unicode(16) InfiniteIterator
  [55]=
  unicode(13) RegexIterator
  [56]=
  unicode(22) RecursiveRegexIterator
  [57]=
  unicode(13) EmptyIterator
  [58]=
  unicode(11) ArrayObject
  [59]=
  unicode(13) ArrayIterator
  [60]=
  unicode(22) RecursiveArrayIterator
  [61]=
  unicode(11) SplFileInfo
  [62]=
  unicode(17) DirectoryIterator
  [63]=
  unicode(26) RecursiveDirectoryIterator
  [64]=
  unicode(13) SplFileObject
  [65]=
  unicode(17) SplTempFileObject
  [66]=
  unicode(17) SimpleXMLIterator
  [67]=
  unicode(14) LogicException
  [68]=
  unicode(24) BadFunctionCallException
  [69]=
  unicode(22) BadMethodCallException
  [70]=
  unicode(15) DomainException
  [71]=
  unicode(24) InvalidArgumentException
  [72]=
  unicode(15) LengthException
  [73]=
  unicode(19) OutOfRangeException
  [74]=
  unicode(16) RuntimeException
  [75]=
  unicode(20) OutOfBoundsException
  [76]=
  unicode(17