Overview

Packages

  • None
  • pdb

Classes

  • Java
  • java_AbstractJava
  • java_ApplyArg
  • java_Arg
  • java_ArrayProxy
  • java_ArrayProxyFactory
  • java_CacheEntry
  • java_ChunkedSocketChannel
  • java_class
  • java_Client
  • java_CompositeArg
  • java_EmptyChannel
  • java_ExceptionProxy
  • java_ExceptionProxyFactory
  • java_GlobalRef
  • java_HttpTunnelHandler
  • java_InternalJava
  • java_IteratorProxy
  • java_IteratorProxyFactory
  • java_JavaProxy
  • java_JavaProxyProxy
  • java_NativeParser
  • java_objectIterator
  • java_Parser
  • java_ParserString
  • java_ParserTag
  • java_Protocol
  • java_ProxyFactory
  • java_SimpleFactory
  • java_SimpleHttpHandler
  • java_SimpleHttpTunnelHandler
  • java_SimpleParser
  • java_SocketChannel
  • java_SocketChannelP
  • java_SocketHandler
  • java_ThrowExceptionProxyFactory
  • JavaClass

Interfaces

  • java_JavaType

Exceptions

  • java_ConnectException
  • java_exception
  • java_IllegalArgumentException
  • java_IllegalStateException
  • java_InternalException
  • java_IOException
  • java_JavaException
  • java_RuntimeException
  • JavaException

Functions

  • __javaproxy_Client_getClient
  • Java
  • java_autoload
  • java_autoload_function
  • java_autoload_function5
  • java_begin_document
  • java_call_with_continuation
  • java_cast
  • java_cast_internal
  • java_checkCliSapi
  • java_closure
  • java_closure_array
  • java_context
  • java_defineHostFromInitialQuery
  • java_end_document
  • java_eval
  • java_get_base
  • java_get_closure
  • java_get_context
  • java_get_lifetime
  • java_get_server_name
  • java_get_session
  • java_get_values
  • java_getCompatibilityOption
  • java_getHeader
  • java_inspect
  • java_inspect_internal
  • java_instanceof
  • java_instanceof_internal
  • java_invoke
  • java_is_false
  • java_is_null
  • java_is_true
  • java_isfalse
  • java_isnull
  • java_istrue
  • java_last_exception_clear
  • java_last_exception_get
  • java_require
  • java_reset
  • java_server_name
  • java_session
  • java_session_array
  • java_set_encoding
  • java_set_file_encoding
  • java_shutdown
  • java_truncate
  • java_unwrap
  • java_values
  • java_values_internal
  • java_virtual
  • java_wrap
  • Overview
  • Package
  • Function
  • Todo
  • Deprecated

Function java_cast

Converts the java object obj into a PHP value.

This procedure converts the Java argument and then calls java_values() to fetch its content. Use java_values() if the conversion is not necessary.

The second argument must be [s]tring, [b]oolean, [i]nteger, [f]loat or [d]ouble, [a]rray, [n]ull or [o]bject (which does nothing).


Example:

$str = new java("java.lang.String", "12");
echo is_string ($str) ? "#t":"#f";
=> #f
$phpString = (string)$str;
echo is_string ($phpString) ? "#t":"#f";
=> #t
$phpNumber = (integer)(string)$str;
echo $phpNumber;
=> 12
$phpNumber2 = java_cast($str, "integer");
echo $phpNumber2;
=> 12
License: GPL
Author: Jost Boekemeier
See: java_values()
Located at JavaProxy.inc
Parameters summary
object $object java object
string $type PHP type description, either [Ss]tring, [Bb]oolean, [Ll]ong or [Ii]nteger, [Dd]ouble or [Ff]loat, [Nn]ull, [Aa]rray, [Oo]bject.
VM Bridge API documentation generated by ApiGen