php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28013 using java get*() in a switch statement
Submitted: 2004-04-15 17:35 UTC Modified: 2004-04-15 19:12 UTC
From: pcarmody at c-spanarchives dot org Assigned:
Status: Not a bug Package: Java related
PHP Version: 4.3.4 OS: Solaris 8
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
46 - 35 = ?
Subscribe to this entry?

 
 [2004-04-15 17:35 UTC] 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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-04-15 19:12 UTC] sniper@php.net
See the other Java related bugs. (This extension is not supported anymore)

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 17:01:30 2024 UTC