#46593 [NEW]: $object instanceof __CLASS__ is not allowed

2008-11-17 Thread jtaal at eljakim dot nl
From: jtaal at eljakim dot nl
Operating system: Irrelevant
PHP version:  5.2.6
PHP Bug Type: Feature/Change Request
Bug description:  $object instanceof __CLASS__ is not allowed

Description:

The PHP parser currently cannot handle __CLASS__ directly after
instanceof. I think this should be possible.

Reproduce code:
---
class myclass {
function mymethod($otherObject) {
if ($otherObject instanceof __CLASS__) {
$otherObject-mymethod(null);
}
return 'works!';
}
}

$a = new myclass();
print $a-mymethod($a);

Expected result:

works!

Actual result:
--
Parse error: syntax error, unexpected T_CLASS_C, expecting T_STRING or
T_VARIABLE or '$' in ... on line 4

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



#46593 [Opn-Csd]: $object instanceof __CLASS__ is not allowed

2008-11-17 Thread jtaal at eljakim dot nl
 ID:   46593
 User updated by:  jtaal at eljakim dot nl
 Reported By:  jtaal at eljakim dot nl
-Status:   Open
+Status:   Closed
 Bug Type: Feature/Change Request
 Operating System: Irrelevant
 PHP Version:  5.2.6
 New Comment:

I've found the solution:

$otherObject instanceof self

(maybe someone can find this issue using a searchengine)


Previous Comments:


[2008-11-17 13:17:22] jtaal at eljakim dot nl

Description:

The PHP parser currently cannot handle __CLASS__ directly after
instanceof. I think this should be possible.

Reproduce code:
---
class myclass {
function mymethod($otherObject) {
if ($otherObject instanceof __CLASS__) {
$otherObject-mymethod(null);
}
return 'works!';
}
}

$a = new myclass();
print $a-mymethod($a);

Expected result:

works!

Actual result:
--
Parse error: syntax error, unexpected T_CLASS_C, expecting T_STRING or
T_VARIABLE or '$' in ... on line 4





-- 
Edit this bug report at http://bugs.php.net/?id=46593edit=1



#45801 [Com]: PHPUnit testcase crashes (segfault)

2008-08-13 Thread jtaal at eljakim dot nl
 ID:   45801
 Comment by:   jtaal at eljakim dot nl
 Reported By:  jtaal at eljakim dot nl
 Status:   Feedback
 Bug Type: Reproducible crash
 Operating System: *
 PHP Version:  5.2.6
 Assigned To:  fb-req-jani
 New Comment:

Sebastian Bergman managed to narrow it down:
http://bugs.php.net/bug.php?id=45805

please close this bug


Previous Comments:


[2008-08-13 01:04:25] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows (zip):
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip

For Windows (installer):

  http://snaps.php.net/win32/php5.2-win32-installer-latest.msi





[2008-08-12 16:22:27] jtaal at eljakim dot nl

Description:

I'm getting a segmentation fault when running a very simple PHPUnit
testcase.
I'm using the latest pear package from pear.phpunit.de.

The testcase is issuing an E_STRICT.

I think deep inside PHPUnit something happens that causes this to
happen. However, since PHPUnit is just a bunch of PHP classes, I dare
say this is a bug inside the PHP interpreter.

I've been able to run and crash this on both Linux (debian lenny) and
Windows XP SP3 (both using PHP 5.2.6).


Reproduce code:
---
?php // MyTest.php
require_once 'PHPUnit/Framework.php';

class MyObject {
public function getX() {
return NULL;
}
}

class MyTest extends PHPUnit_Framework_TestCase {
public function test1() {
$obj = new MyObject;
$source =  $obj-getX();
}
}

Actual result:
--
$ phpunit MyTest.php

Strict Standards: Only variables should be assigned by reference in
/home/jtaal/public_html/MyTest.php on line 18
PHPUnit 3.2.21 by Sebastian Bergmann.

Segmentation fault






-- 
Edit this bug report at http://bugs.php.net/?id=45801edit=1



#45801 [NEW]: PHPUnit testcase crashes (segfault)

2008-08-12 Thread jtaal at eljakim dot nl
From: jtaal at eljakim dot nl
Operating system: Linux  Windows
PHP version:  5.2.6
PHP Bug Type: Reproducible crash
Bug description:  PHPUnit testcase crashes (segfault)

Description:

I'm getting a segmentation fault when running a very simple PHPUnit
testcase.
I'm using the latest pear package from pear.phpunit.de.

The testcase is issuing an E_STRICT.

I think deep inside PHPUnit something happens that causes this to happen.
However, since PHPUnit is just a bunch of PHP classes, I dare say this is
a bug inside the PHP interpreter.

I've been able to run and crash this on both Linux (debian lenny) and
Windows XP SP3 (both using PHP 5.2.6).


Reproduce code:
---
?php // MyTest.php
require_once 'PHPUnit/Framework.php';

class MyObject {
public function getX() {
return NULL;
}
}

class MyTest extends PHPUnit_Framework_TestCase {
public function test1() {
$obj = new MyObject;
$source =  $obj-getX();
}
}

Actual result:
--
$ phpunit MyTest.php

Strict Standards: Only variables should be assigned by reference in
/home/jtaal/public_html/MyTest.php on line 18
PHPUnit 3.2.21 by Sebastian Bergmann.

Segmentation fault


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



#45773 [NEW]: is_static_method

2008-08-09 Thread jtaal at eljakim dot nl
From: jtaal at eljakim dot nl
Operating system: Irrelevant
PHP version:  5.2.6
PHP Bug Type: Feature/Change Request
Bug description:  is_static_method

Description:

I'd like to be able to find out whether a method is static, without using
ReflectionMethod. It keeps code cleaner that doesn't need object oriented
reflection. It could also be somewhat quicker (avoiding to instantiate a
Reflection object).




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



#45768 [NEW]: parse_ini_file and the hash character

2008-08-08 Thread jtaal at eljakim dot nl
From: jtaal at eljakim dot nl
Operating system: debian etch
PHP version:  5.2.6
PHP Bug Type: Feature/Change Request
Bug description:  parse_ini_file and the hash character

Description:

On linux commenting lines in ini like files is oftenly done with #
characters instead of ; characters (my.cnf for example)
Maybe there should be a setting where you can set (an array of) the
comment start characters?


Reproduce code:
---
array parse_ini_file ( string $filename [[, bool $process_sections ],
array $comment_delimiters ])


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



#32262 [NEW]: make require accept wildcards

2005-03-10 Thread jtaal at eljakim dot nl
From: jtaal at eljakim dot nl
Operating system: Linux
PHP version:  4.3.10
PHP Bug Type: Feature/Change Request
Bug description:  make require accept wildcards

Description:

I have a series of classes in PHP 4.3, there is no autoload feature there
so I named all my files class.$className.inc.php.
I created the class.inc.php file which require_onces all class.*.inc.php
files.
This works fine for files which are inside the same directory as
class.*.inc.php
BUT, when I include class.inc.php from another directory the `ls
$wildcard` comes up empty, thus nothing is included.

Wouldn't it be a good feature to have a require_once_wildcard which
includes files.
A problem that may rise is the includeSearchPath (in which directory
should the wildcard be executed?). A solution is to execute only in the
directory where the file resides which calls require_once_wildcard.

My source for require_once_wildcard is in the Reproduce code field.


Reproduce code:
---
function require_once_wildcard($wildcard) {
  $ls = `ls $wildcard`;
  $ls = explode(\n, $ls);
  array_pop($ls); // strip last empty line
  print_r($ls);
  foreach ($ls as $inc) {
require_once($inc);
  }
}



-- 
Edit bug report at http://bugs.php.net/?id=32262edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=32262r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=32262r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=32262r=trysnapshot51
Fixed in CVS:http://bugs.php.net/fix.php?id=32262r=fixedcvs
Fixed in release:http://bugs.php.net/fix.php?id=32262r=alreadyfixed
Need backtrace:  http://bugs.php.net/fix.php?id=32262r=needtrace
Need Reproduce Script:   http://bugs.php.net/fix.php?id=32262r=needscript
Try newer version:   http://bugs.php.net/fix.php?id=32262r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=32262r=support
Expected behavior:   http://bugs.php.net/fix.php?id=32262r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=32262r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=32262r=submittedtwice
register_globals:http://bugs.php.net/fix.php?id=32262r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=32262r=php3
Daylight Savings:http://bugs.php.net/fix.php?id=32262r=dst
IIS Stability:   http://bugs.php.net/fix.php?id=32262r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=32262r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=32262r=float
No Zend Extensions:  http://bugs.php.net/fix.php?id=32262r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=32262r=mysqlcfg


#32262 [WFx]: make require accept wildcards

2005-03-10 Thread jtaal at eljakim dot nl
 ID:   32262
 User updated by:  jtaal at eljakim dot nl
 Reported By:  jtaal at eljakim dot nl
 Status:   Wont fix
 Bug Type: Feature/Change Request
 Operating System: *
 PHP Version:  4.3.*
 New Comment:

will there be a 4.4 branch?


Previous Comments:


[2005-03-10 12:19:58] [EMAIL PROTECTED]

Sorry no new features in the 4.3 branch.



[2005-03-10 12:13:31] jtaal at eljakim dot nl

Description:

I have a series of classes in PHP 4.3, there is no autoload feature
there so I named all my files class.$className.inc.php.
I created the class.inc.php file which require_onces all
class.*.inc.php files.
This works fine for files which are inside the same directory as
class.*.inc.php
BUT, when I include class.inc.php from another directory the `ls
$wildcard` comes up empty, thus nothing is included.

Wouldn't it be a good feature to have a require_once_wildcard which
includes files.
A problem that may rise is the includeSearchPath (in which directory
should the wildcard be executed?). A solution is to execute only in the
directory where the file resides which calls require_once_wildcard.

My source for require_once_wildcard is in the Reproduce code field.


Reproduce code:
---
function require_once_wildcard($wildcard) {
  $ls = `ls $wildcard`;
  $ls = explode(\n, $ls);
  array_pop($ls); // strip last empty line
  print_r($ls);
  foreach ($ls as $inc) {
require_once($inc);
  }
}







-- 
Edit this bug report at http://bugs.php.net/?id=32262edit=1