#28013 [Opn->Bgs]: using java get*() in a switch statement

From: Date: Thu, 15 Apr 2004 23:12:37 +0000
Subject: #28013 [Opn->Bgs]: using java get*() in a switch statement
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-58216@lists.php.net to get a copy of this message
 ID:               28013
 Updated by:       sniper@php.net
 Reported By:      pcarmody at c-spanarchives dot org
-Status:           Open
+Status:           Bogus
 Bug Type:         Java related
 Operating System: Solaris 8
 PHP Version:      4.3.4
 New Comment:

See the other Java related bugs. (This extension is not supported
anymore)



Previous Comments:
------------------------------------------------------------------------

[2004-04-15 17:35:59] pcarmody at c-spanarchives dot org

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 this bug report at http://bugs.php.net/?id=28013&edit=1


Thread (2 messages)

« previous php.bugs (#58216) next »