php 5.3 errors

Help
Anonymous
2009-07-15
2013-06-06
  • Anonymous

    Anonymous - 2009-07-15

    Since PHP 5.3 deprecates the use of the old ereg functions, nusoap now throws a ton of E_DEPRECATED warnings. Example:

    Deprecated: Assigning the return value of new by reference is deprecated in /home/gmiernicki/public_html/dev/mpw/nusoap.php on line 7381

    Deprecated: Function ereg() is deprecated in /home/gmiernicki/public_html/dev/mpw/nusoap.php on line 7425

    Deprecated: Function ereg() is deprecated in /home/gmiernicki/public_html/dev/mpw/nusoap.php on line 2176

    Deprecated: Function ereg() is deprecated in /home/gmiernicki/public_html/dev/mpw/nusoap.php on line 7447

    Deprecated: Function ereg() is deprecated in /home/gmiernicki/public_html/dev/mpw/nusoap.php on line 2939

    Deprecated: Function split() is deprecated in /home/gmiernicki/public_html/dev/mpw/nusoap.php on line 3309

    Deprecated: Function split() is deprecated in /home/gmiernicki/public_html/dev/mpw/nusoap.php on line 3309

    Deprecated: Function split() is deprecated in /home/gmiernicki/public_html/dev/mpw/nusoap.php on line 3309

    Deprecated: Function eregi() is deprecated in /home/gmiernicki/public_html/dev/mpw/nusoap.php on line 7509

    Deprecated: Function ereg() is deprecated in /home/gmiernicki/public_html/dev/mpw/nusoap.php on line 6590

    Deprecated: Function ereg() is deprecated in /home/gmiernicki/public_html/dev/mpw/nusoap.php on line 6590

    Deprecated: Function ereg() is deprecated in /home/gmiernicki/public_html/dev/mpw/nusoap.php on line 6590

    Deprecated: Function ereg() is deprecated in /home/gmiernicki/public_html/dev/mpw/nusoap.php on line 6590

    Deprecated: Function ereg() is deprecated in /home/gmiernicki/public_html/dev/mpw/nusoap.php on line 6590

    Deprecated: Function ereg() is deprecated in /home/gmiernicki/public_html/dev/mpw/nusoap.php on line 6627

    If I was an expert on regular expressions, I would gladly port these, but I am not however, and look to the developers here to provide this fix in the next release.

    Regards,
    Greg

     
    • pixelchutes

      pixelchutes - 2009-07-28

      http://php.net/manual/en/migration53.deprecated.php

      split => preg_split
      ereg = preg_match
      eregi = preg_match (using case-insensitive "i" flag)

      As for the "return value by reference", the change is as easy as removing the ampersand (&).

      e.g.
      $this->wsdl =& new wsdl( ...
      becomes
      $this->wsdl = new wsdl( ...

      When is the next scheduled new release for NuSOAP anyway? It's been almost two years since the last stable release!

       
      • pixelchutes

        pixelchutes - 2009-08-28

        FYI, I believe I was mistaken. For clarification, NuSOAP should still work in PHP 5.3.0, however it seems the functions I listed above are only deprecate "in PHP 5.3.0 for FUTURE removal. This means that they should still be valid functions and would still exist (for now). It only becomes an issue if the new E_DEPRECATED error level is being used in error_reporting().

        I still have an updated version updated those functions that were marked deprecated, since we do use this new E_DEPRECATED error level... Sorry for the misunderstanding!

         
    • pixelchutes

      pixelchutes - 2009-07-28

      I have a modified 0.73 (1.114) available w/ PHP 5.3.0 updates addressed. Is there anyway to post a file for review/share?

       
  • Anonymous

    Anonymous - 2009-10-21

    Hello,

    i have the same problem because my company have migrate to PHP 5.3 yesterday.

    I've just post a zip file : http://dl.free.fr/rVgYsOgfa
    I have changed all ereg py preg_match.
    Nusoap work fine in 5.3 and previous version.

    Regard's,
    ANexus.

     
  • stefano bozzoni

    stefano bozzoni - 2009-10-27

    I found another problem, i don't know if it is caused by PHP 5.3 version , but when my web service function returns a string i got this error in the soap envelope:
    " get_class() expects parameter 1 to be object, string given in <b>C:\wamp\www\prova\lib\nusoap.php</b> on line <b>4021</b>"
    I guess it is cause by the get_class function that is applied to a string parameter (the return value of my webservice method) , but get_class now aspect an object and gives an error  if it isn't.
    So i changed the line n. 4021 of nusoap.php in this way:
    if (is_object($this->methodreturn) && (isset($this->methodreturn) && ((get_class($this->methodreturn) == 'soap_fault') || (get_class($this->methodreturn) == 'nusoap_fault')))) {…
    Now it works…
    Does anybody know if it is right?

    Best regards, Ste.

     
  • tantaoui

    tantaoui - 2009-10-31

    the version proposed by **ANexus** is very good, but it needs some changes to be perfect :

    replace `if(preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/',$enc))` by `if(preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i',$enc))` in line 7328, 3757, 4217 and 7509.

    replace `if (isset($this->methodreturn) && ((get_class($this->methodreturn) == 'soap_fault') || (get_class($this->methodreturn) == 'nusoap_fault'))) {` by `if (isset($this->methodreturn) && is_object($this->methodreturn) && ((get_class($this->methodreturn) == 'soap_fault') || (get_class($this->methodreturn) == 'nusoap_fault'))) {` in line 4021

    Regard's, Jamal

     
  • Anonymous

    Anonymous - 2009-12-01

    Still no solution?

     
  • Auston Costa

    Auston Costa - 2010-04-14

    I pass by same, your sugestions works fine!

    Great!

     
  • Scott Nichol

    Scott Nichol - 2010-04-26

    NuSOAP 0.9.5 should fix these problems.

     

Log in to post a comment.