title: About extending core classes in PHP ( Example Soap Client )
body: <p>I have being developing in PHP since a while now and I never had the situation where I need to extend from a core class in PHP.</p>
  
  <p>I have an issue that I have a Soap Webservices Provider that had his SOAP Services awefully written, so the PHP-CLIENT class gives me a lot of validation errors. Any way, their SOAP "works", not as it should but it does.</p>
  
  <p>What I wanted to do is extend from this class and modify the validation, for example for not controlling that the targetNamespace has a diffeent name that the location. I know that I shouldn't do this, but I don't want to write a SOAP Class from the scratch.</p>
  
  <p>When I was trying to extend from this class ( SoapClient ) I realized that there is no code at all in the methods, and I could not find the reason why. I was thinking that maybe is because these methods works under the "C" enviroment, or that they are already compiled to make it faster. If this is not the case I would love to see the code for this class and modify it for my needs.</p>
  
  <p>Any suggestions, tips or explanations are welcome. I am attaching the SoapClient Code.</p>
  
  <pre><code>class SoapClient  {
  
  /**
   * (PHP 5 &amp;gt;= 5.0.1)&lt;br/&gt;
   * SoapClient constructor
   * @link http://php.net/manual/en/soapclient.soapclient.php
   * @param mixed $wsdl &lt;p&gt;
   * URI of the WSDL file or &lt;b&gt;NULL&lt;/b&gt; if working in
   * non-WSDL mode.
   * &lt;/p&gt;
   * &lt;p&gt;
   * During development, WSDL caching may be disabled by the
   * use of the soap.wsdl_cache_ttl &lt;i&gt;php.ini&lt;/i&gt; setting
   * otherwise changes made to the WSDL file will have no effect until
   * soap.wsdl_cache_ttl is expired.
   * &lt;/p&gt;
   * @param array $options [optional] &lt;p&gt;
   * An array of options. If working in WSDL mode, this parameter is optional.
   * If working in non-WSDL mode, the location and
   * uri options must be set, where location
   * is the URL of the SOAP server to send the request to, and uri
   * is the target namespace of the SOAP service.
   * &lt;/p&gt;
   * &lt;p&gt;
   * The style and use options only work in
   * non-WSDL mode. In WSDL mode, they come from the WSDL file.
   * &lt;/p&gt;
   * &lt;p&gt;
   * The soap_version option should be one of either
   * &lt;b&gt;SOAP_1_1&lt;/b&gt; or &lt;b&gt;SOAP_1_2&lt;/b&gt; to
   * select SOAP 1.1 or 1.2, respectively. If omitted, 1.1 is used.
   * &lt;/p&gt;
   * &lt;p&gt;
   * For HTTP authentication, the login and
   * password options can be used to supply credentials.
   * For making an HTTP connection through
   * a proxy server, the options proxy_host,
   * proxy_port, proxy_login
   * and proxy_password are also available.
   * For HTTPS client certificate authentication use
   * local_cert and passphrase options. An
   * authentication may be supplied in the authentication
   * option. The authentication method may be either
   * &lt;b&gt;SOAP_AUTHENTICATION_BASIC&lt;/b&gt; (default) or
   * &lt;b&gt;SOAP_AUTHENTICATION_DIGEST&lt;/b&gt;.
   * &lt;/p&gt;
   * &lt;p&gt;
   * The compression option allows to use compression
   * of HTTP SOAP requests and responses.
   * &lt;/p&gt;
   * &lt;p&gt;
   * The encoding option defines internal character
   * encoding. This option does not change the encoding of SOAP requests (it is
   * always utf-8), but converts strings into it.
   * &lt;/p&gt;
   * &lt;p&gt;
   * The trace option enables tracing of request so faults
   * can be backtraced. This defaults to &lt;b&gt;FALSE&lt;/b&gt;
   * &lt;/p&gt;
   * &lt;p&gt;
   * The classmap option can be used to map some WSDL
   * types to PHP classes. This option must be an array with WSDL types
   * as keys and names of PHP classes as values.
   * &lt;/p&gt;
   * &lt;p&gt;
   * Setting the boolean trace option enables use of the
   * methods
   * SoapClient-&gt;__getLastRequest,
   * SoapClient-&gt;__getLastRequestHeaders,
   * SoapClient-&gt;__getLastResponse and
   * SoapClient-&gt;__getLastResponseHeaders.
   * &lt;/p&gt;
   * &lt;p&gt;
   * The exceptions option is a boolean value defining whether
   * soap errors throw exceptions of type
   * SoapFault.
   * &lt;/p&gt;
   * &lt;p&gt;
   * The connection_timeout option defines a timeout in seconds
   * for the connection to the SOAP service. This option does not define a timeout
   * for services with slow responses. To limit the time to wait for calls to finish the
   * default_socket_timeout setting
   * is available.
   * &lt;/p&gt;
   * &lt;p&gt;
   * The typemap option is an array of type mappings.
   * Type mapping is an array with keys type_name,
   * type_ns (namespace URI), from_xml
   * (callback accepting one string parameter) and to_xml
   * (callback accepting one object parameter).
   * &lt;/p&gt;
   * &lt;p&gt;
   * The cache_wsdl option is one of
   * &lt;b&gt;WSDL_CACHE_NONE&lt;/b&gt;,
   * &lt;b&gt;WSDL_CACHE_DISK&lt;/b&gt;,
   * &lt;b&gt;WSDL_CACHE_MEMORY&lt;/b&gt; or
   * &lt;b&gt;WSDL_CACHE_BOTH&lt;/b&gt;.
   * &lt;/p&gt;
   * &lt;p&gt;
   * The user_agent option specifies string to use in
   * User-Agent header.
   * &lt;/p&gt;
   * &lt;p&gt;
   * The stream_context option is a resource
   * for context.
   * &lt;/p&gt;
   * &lt;p&gt;
   * The features option is a bitmask of
   * &lt;b&gt;SOAP_SINGLE_ELEMENT_ARRAYS&lt;/b&gt;,
   * &lt;b&gt;SOAP_USE_XSI_ARRAY_TYPE&lt;/b&gt;,
   * &lt;b&gt;SOAP_WAIT_ONE_WAY_CALLS&lt;/b&gt;.
   * &lt;/p&gt;
   * &lt;p&gt;
   * The keep_alive option is a boolean value defining whether
   * to send the Connection: Keep-Alive header or
   * Connection: close.
   * &lt;/p&gt;
   * &lt;p&gt;
   * The ssl_method option is one of
   * &lt;b&gt;SOAP_SSL_METHOD_TLS&lt;/b&gt;,
   * &lt;b&gt;SOAP_SSL_METHOD_SSLv2&lt;/b&gt;,
   * &lt;b&gt;SOAP_SSL_METHOD_SSLv3&lt;/b&gt; or
   * &lt;b&gt;SOAP_SSL_METHOD_SSLv23&lt;/b&gt;.
   * &lt;/p&gt;
   */
  public function SoapClient ($wsdl, array $options = null) {}
  
  /**
   * (PHP 5 &amp;gt;= 5.0.1)&lt;br/&gt;
   * Calls a SOAP function (deprecated)
   * @link http://php.net/manual/en/soapclient.call.php
   * @param string $function_name
   * @param string $arguments
   * @return mixed
   */
  public function __call ($function_name, $arguments) {}
  
  /**
   * (PHP 5 &amp;gt;= 5.0.1)&lt;br/&gt;
   * Calls a SOAP function
   * @link http://php.net/manual/en/soapclient.soapcall.php
   * @param string $function_name &lt;p&gt;
   * The name of the SOAP function to call.
   * &lt;/p&gt;
   * @param array $arguments &lt;p&gt;
   * An array of the arguments to pass to the function. This can be either
   * an ordered or an associative array. Note that most SOAP servers require
   * parameter names to be provided, in which case this must be an
   * associative array.
   * &lt;/p&gt;
   * @param array $options [optional] &lt;p&gt;
   * An associative array of options to pass to the client.
   * &lt;/p&gt;
   * &lt;p&gt;
   * The location option is the URL of the remote Web service.
   * &lt;/p&gt;
   * &lt;p&gt;
   * The uri option is the target namespace of the SOAP service.
   * &lt;/p&gt;
   * &lt;p&gt;
   * The soapaction option is the action to call.
   * &lt;/p&gt;
   * @param mixed $input_headers [optional] &lt;p&gt;
   * An array of headers to be sent along with the SOAP request.
   * &lt;/p&gt;
   * @param array $output_headers [optional] &lt;p&gt;
   * If supplied, this array will be filled with the headers from the SOAP response.
   * &lt;/p&gt;
   * @return mixed SOAP functions may return one, or multiple values. If only one value is returned
   * by the SOAP function, the return value of __soapCall will be
   * a simple value (e.g. an integer, a string, etc). If multiple values are
   * returned, __soapCall will return
   * an associative array of named output parameters.
   * &lt;/p&gt;
   * &lt;p&gt;
   * On error, if the SoapClient object was constructed with the exceptions
   * option set to &lt;b&gt;FALSE&lt;/b&gt;, a SoapFault object will be returned.
   */
  public function __soapCall ($function_name, array $arguments, array $options = null, $input_headers = null, array &amp;$output_headers = null) {}
  
  /**
   * (PHP 5 &amp;gt;= 5.0.1)&lt;br/&gt;
   * Returns last SOAP request
   * @link http://php.net/manual/en/soapclient.getlastrequest.php
   * @return string The last SOAP request, as an XML string.
   */
  public function __getLastRequest () {}
  
  /**
   * (PHP 5 &amp;gt;= 5.0.1)&lt;br/&gt;
   * Returns last SOAP response
   * @link http://php.net/manual/en/soapclient.getlastresponse.php
   * @return string The last SOAP response, as an XML string.
   */
  public function __getLastResponse () {}
  
  /**
   * (PHP 5 &amp;gt;= 5.0.1)&lt;br/&gt;
   * Returns the SOAP headers from the last request
   * @link http://php.net/manual/en/soapclient.getlastrequestheaders.php
   * @return string The last SOAP request headers.
   */
  public function __getLastRequestHeaders () {}
  
  /**
   * (PHP 5 &amp;gt;= 5.0.1)&lt;br/&gt;
   * Returns the SOAP headers from the last response
   * @link http://php.net/manual/en/soapclient.getlastresponseheaders.php
   * @return string The last SOAP response headers.
   */
  public function __getLastResponseHeaders () {}
  
  /**
   * (PHP 5 &amp;gt;= 5.0.1)&lt;br/&gt;
   * Returns list of available SOAP functions
   * @link http://php.net/manual/en/soapclient.getfunctions.php
   * @return array The array of SOAP function prototypes, detailing the return type,
   * the function name and type-hinted paramaters.
   */
  public function __getFunctions () {}
  
  /**
   * (PHP 5 &amp;gt;= 5.0.1)&lt;br/&gt;
   * Returns a list of SOAP types
   * @link http://php.net/manual/en/soapclient.gettypes.php
   * @return array The array of SOAP types, detailing all structures and types.
   */
  public function __getTypes () {}
  
  /**
   * (PHP 5 &amp;gt;= 5.0.1)&lt;br/&gt;
   * Performs a SOAP request
   * @link http://php.net/manual/en/soapclient.dorequest.php
   * @param string $request &lt;p&gt;
   * The XML SOAP request.
   * &lt;/p&gt;
   * @param string $location &lt;p&gt;
   * The URL to request.
   * &lt;/p&gt;
   * @param string $action &lt;p&gt;
   * The SOAP action.
   * &lt;/p&gt;
   * @param int $version &lt;p&gt;
   * The SOAP version.
   * &lt;/p&gt;
   * @param int $one_way [optional] &lt;p&gt;
   * If one_way is set to 1, this method returns nothing.
   * Use this where a response is not expected.
   * &lt;/p&gt;
   * @return string The XML SOAP response.
   */
  public function __doRequest ($request, $location, $action, $version, $one_way = 0) {}
  
  /**
   * (PHP 5 &amp;gt;= 5.0.4)&lt;br/&gt;
   * The __setCookie purpose
   * @link http://php.net/manual/en/soapclient.setcookie.php
   * @param string $name &lt;p&gt;
   * The name of the cookie.
   * &lt;/p&gt;
   * @param string $value [optional] &lt;p&gt;
   * The value of the cookie. If not specified, the cookie will be deleted.
   * &lt;/p&gt;
   * @return void No value is returned.
   */
  public function __setCookie ($name, $value = null) {}
  
  public function __getCookies () {}
  
  /**
   * (PHP 5 &amp;gt;= 5.0.1)&lt;br/&gt;
   * Sets the location of the Web service to use
   * @link http://php.net/manual/en/soapclient.setlocation.php
   * @param string $new_location [optional] &lt;p&gt;
   * The new endpoint URL.
   * &lt;/p&gt;
   * @return string The old endpoint URL.
   */
  public function __setLocation ($new_location = null) {}
  
  /**
   * (PHP 5 &amp;gt;= 5.0.5)&lt;br/&gt;
   * Sets SOAP headers for subsequent calls
   * @link http://php.net/manual/en/soapclient.setsoapheaders.php
   * @param mixed $soapheaders [optional] &lt;p&gt;
   * The headers to be set. It could be &lt;b&gt;SoapHeader&lt;/b&gt;
   * object or array of &lt;b&gt;SoapHeader&lt;/b&gt; objects.
   * If not specified or set to &lt;b&gt;NULL&lt;/b&gt;, the headers will be deleted.
   * &lt;/p&gt;
   * @return bool &lt;b&gt;TRUE&lt;/b&gt; on success or &lt;b&gt;FALSE&lt;/b&gt; on failure.
   */
  public function __setSoapHeaders ($soapheaders = null) {}
  </code></pre>
  
  <p>}</p>