#28013 [NEW]: using java get*() in a switch statement

From: Date: Thu, 15 Apr 2004 21:35:59 +0000
Subject: #28013 [NEW]: using java get*() in a switch statement
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-58209@lists.php.net to get a copy of this message
From:             pcarmody at c-spanarchives dot org
Operating system: Solaris 8
PHP version:      4.3.4
PHP Bug Type:     Java related
Bug description:  using java get*() in a switch statement

Description:
------------
When using the auto-JavaBean style access to member variables in a switch
statement causes a core dump.  Specifying the method name directly avoids
this problem.

Reproduce code:
---------------
Java class:
public class Blah {
  private int blah;
  public Blah() {
    this.blah = 1;
  }
  public int getBlah() {
    return this.blah;
  }
}

PHP call:
<?php
$blah = new Java( "Blah" );
switch ( $blah->blah ) {
  case 1:
    break;
}
?>

Expected result:
----------------
Exits normally.


Actual result:
--------------
A core dump.

If you replace $blah->blah with $blah->getBlah() the code will work
correctly.

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


Thread (2 messages)

« previous php.bugs (#58209) next »