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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: pcarmody at c-spanarchives dot org
New email:
PHP Version: OS:

 

 [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-2021 The PHP Group
All rights reserved.
Last updated: Wed Dec 08 16:03:35 2021 UTC