|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-09-08 12:00 UTC] bridge at gsnet dot com
[2000-09-13 01:43 UTC] bridge at gsnet dot com
[2000-11-21 03:30 UTC] sniper@php.net
[2000-12-30 12:14 UTC] sniper@php.net
[2001-01-30 03:46 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 13:00:01 2025 UTC |
If I call a java object twice from PHP-4.0.2 and assign the result to the same variable, it generates a segmentation fault (under both ibm-jdk118 and Blackdown JDK1.2.2-RC4). If I change the second occurrence of "aStrings" to, say, "aStrings2" it works fine. Note that to reproduce this problem, you may need to reload it more than once. It crashes about as many times as it works on my configuration. Heres' the PHP code: <? $jTest = new Java("PHPTest"); print("Here is an Array of Strings:<br>\n"); $aStrings = $jTest->getAnArrayOfStrings(); for($j=0; $j<sizeof($aStrings); $j++) { print("<i>".$j."=".$aStrings[$j]."</i><br>\n"); } print("<br>"); print("Here it is again:<br>\n"); $aStrings=$jTest->getAnArrayOfStrings(); for($j=0; $j<sizeof($aStrings); $j++) { print("<i>".$j."=".$aStrings[$j]."</i><br>\n"); } ?> Here's the Java code from PHPTest.java public class PHPTest { public String getAString() { return "This is a String"; } public String[] getAnArrayOfStrings() { return new String[]{"Element 1", "Element 2", "Element 3", "Element 4"}; } } The non-default part of my php.ini: [java] java.class.path=/usr/local/lib/php_java.jar:/home/bridge/gsnlib/classes:/usr/local/lib/php_java.jar:/home/bridge/externlib:/home/bridge/externlib/Una_Enterprise.zip java.library.path=/home/bridge/externlib/modules java.library=/usr/local/jdk1.2.2-RC4/jre/lib/i386/libjava.so extension_dir=/home/bridge/externlib/modules extension=libphp_java.so From php-4.0.2's config.status: ./configure --with-apxs=/usr/local/apache/bin/apxs --with-java --with-mysql