[Tickets #14757] php 7.1 and /usr/local/lib/php/Services/Weather.php:167

noreply at bugs.horde.org noreply at bugs.horde.org
Sat Dec 23 21:24:03 UTC 2017


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: https://bugs.horde.org/ticket/14757
------------------------------------------------------------------------------
  Ticket             | 14757
  Created By         | dpa-bugs at aegee.org
  Summary            | php 7.1 and /usr/local/lib/php/Services/Weather.php:167
  Queue              | Horde Framework Packages
  Type               | Bug
  State              | Unconfirmed
  Priority           | 1. Low
  Milestone          |
  Patch              |
  Owners             |
------------------------------------------------------------------------------


dpa-bugs at aegee.org (2017-12-23 21:24) wrote:

With php 7.1.12 when I visit /admin/config/config.php?app=horde I get:

A fatal error has occurred

syntax error, unexpected 'new' (T_NEW)

in /usr/local/lib/php/Services/Weather.php:167
  1. Horde_Config_Form->__construct()  
/home/htdocs/webmail/admin/config/config.php:35
  2. Horde_Config->readXMLConfig() /usr/local/lib/php/Horde/Config/Form.php:58
  3. Horde_Config->_parseLevel() /usr/local/lib/php/Horde/Config.php:204
  4. Horde_Config->_parseLevel() /usr/local/lib/php/Horde/Config.php:725
  5. Horde_Config->_parseLevel() /usr/local/lib/php/Horde/Config.php:712
  6. Horde_Config->_getEnumValues() /usr/local/lib/php/Horde/Config.php:602
  7. Horde_Config->_handleSpecials() /usr/local/lib/php/Horde/Config.php:1803
  8. Horde_Registry->callAppMethod() /usr/local/lib/php/Horde/Config.php:1874
  9. Horde_Application->configSpecialValues()  
/usr/local/lib/php/Horde/Registry.php:1197
10. Horde_Core_Block_Collection->getBlocksList()  
/home/htdocs/webmail/lib/Application.php:122
11. Horde_Core_Block_Collection->_loadBlocks()  
/usr/local/lib/php/Horde/Core/Block/Collection.php:159
12. Horde_Block_Metar->__construct()  
/usr/local/lib/php/Horde/Core/Block/Collection.php:500
13. class_exists() /home/htdocs/webmail/lib/Block/Metar.php:21
14. spl_autoload_call()
15. Horde_Autoloader->loadClass()
16. Horde_Autoloader->_include() /usr/local/lib/php/Horde/Autoloader.php:65
Details

The full error message is logged in Horde's log file, and is shown  
below only to administrators. Non-administrative users will not see  
error details.

ParseError Object
(
     [message:protected] => syntax error, unexpected 'new' (T_NEW)
     [string:Error:private] => ParseError: syntax error, unexpected  
'new' (T_NEW) in /usr/local/lib/php/Services/Weather.php:167
Stack trace:
#0 /usr/local/lib/php/Horde/Autoloader.php(65):  
Horde_Autoloader->_include('/usr/local/lib/...')
#1 [internal function]: Horde_Autoloader->loadClass('Services_Weathe...')
#2 [internal function]: spl_autoload_call('Services_Weathe...')
#3 /home/htdocs/webmail/lib/Block/Metar.php(21):  
class_exists('Services_Weathe...')
#4 /usr/local/lib/php/Horde/Core/Block/Collection.php(500):  
Horde_Block_Metar->__construct('horde')
#5 /usr/local/lib/php/Horde/Core/Block/Collection.php(159):  
Horde_Core_Block_Collection->_loadBlocks()
#6 /home/htdocs/webmail/lib/Application.php(122):  
Horde_Core_Block_Collection->getBlocksList()
#7 /usr/local/lib/php/Horde/Registry.php(1197):  
Horde_Application->configSpecialValues('blocks')
#8 /usr/local/lib/php/Horde/Config.php(1874):  
Horde_Registry->callAppMethod('horde', 'configSpecialVa...', Array)
#9 /usr/local/lib/php/Horde/Config.php(1803):  
Horde_Config->_handleSpecials(Object(DOMElement))
#10 /usr/local/lib/php/Horde/Config.php(602):  
Horde_Config->_getEnumValues(Object(DOMElement))
#11 /usr/local/lib/php/Horde/Config.php(712):  
Horde_Config->_parseLevel(Array, Object(DOMNodeList), 'portal')
#12 /usr/local/lib/php/Horde/Config.php(725):  
Horde_Config->_parseLevel(Array, Object(DOMNodeList), '')
#13 /usr/local/lib/php/Horde/Config.php(204):  
Horde_Config->_parseLevel(Array, Object(DOMNodeList), '')
#14 /usr/local/lib/php/Horde/Config/Form.php(58):  
Horde_Config->readXMLConfig()
#15 /home/htdocs/webmail/admin/config/config.php(35):  
Horde_Config_Form->__construct(Object(Horde_Variables), 'horde')
#16 {main}
     [code:protected] => 0
     [file:protected] => /usr/local/lib/php/Services/Weather.php
     [line:protected] => 167
     [trace:Error:private] => Array
         (
             [0] => Array
                 (
                     [file] => /usr/local/lib/php/Horde/Autoloader.php
                     [line] => 65
                     [function] => _include
                     [class] => Horde_Autoloader
                     [type] => ->
                     [args] => Array
                         (
                             [0] => /usr/local/lib/php/Services/Weather.php
                         )

                 )

             [1] => Array
                 (
                     [function] => loadClass
                     [class] => Horde_Autoloader
                     [type] => ->
                     [args] => Array
                         (
                             [0] => Services_Weather
                         )

                 )

             [2] => Array
                 (
                     [function] => spl_autoload_call
                     [args] => Array
                         (
                             [0] => Services_Weather
                         )

                 )

             [3] => Array
                 (
                     [file] => /home/htdocs/webmail/lib/Block/Metar.php
                     [line] => 21
                     [function] => class_exists
                     [args] => Array
                         (
                             [0] => Services_Weather
                         )

                 )

             [4] => Array
                 (
                     [file] =>  
/usr/local/lib/php/Horde/Core/Block/Collection.php
                     [line] => 500
                     [function] => __construct
                     [class] => Horde_Block_Metar
                     [type] => ->
                     [args] => Array
                         (
                             [0] => horde
                         )

                 )

             [5] => Array
                 (
                     [file] =>  
/usr/local/lib/php/Horde/Core/Block/Collection.php
                     [line] => 159
                     [function] => _loadBlocks
                     [class] => Horde_Core_Block_Collection
                     [type] => ->
                     [args] => Array
                         (
                         )

                 )

             [6] => Array
                 (
                     [file] => /home/htdocs/webmail/lib/Application.php
                     [line] => 122
                     [function] => getBlocksList
                     [class] => Horde_Core_Block_Collection
                     [type] => ->
                     [args] => Array
                         (
                         )

                 )

             [7] => Array
                 (
                     [file] => /usr/local/lib/php/Horde/Registry.php
                     [line] => 1197
                     [function] => configSpecialValues
                     [class] => Horde_Application
                     [type] => ->
                     [args] => Array
                         (
                             [0] => blocks
                         )

                 )

             [8] => Array
                 (
                     [file] => /usr/local/lib/php/Horde/Config.php
                     [line] => 1874
                     [function] => callAppMethod
                     [class] => Horde_Registry
                     [type] => ->
                     [args] => Array
                         (
                             [0] => horde
                             [1] => configSpecialValues
                             [2] => Array
                                 (
                                     [args] => Array
                                         (
                                             [0] => blocks
                                         )

                                     [noperms] => 1
                                 )

                         )

                 )


and so on.  Removing &new from:
@$obj = &new $classname($options, $error);

makes the code run a emits instead:

Deprecated: Methods with the same name as their class will not be  
constructors in a future version of PHP; Horde_Form_Variable has a  
deprecated constructor in /usr/local/lib/php/Horde/Form/Variable.php  
on line 24

Deprecated: Methods with the same name as their class will not be  
constructors in a future version of PHP; Horde_Form_Action has a  
deprecated constructor in /usr/local/lib/php/Horde/Form/Action.php on  
line 24

Deprecated: Methods with the same name as their class will not be  
constructors in a future version of PHP; Horde_Form_Renderer has a  
deprecated constructor in /usr/local/lib/php/Horde/Form/Renderer.php  
on line 24






More information about the bugs mailing list