6.0.0-alpha12
6/12/25

[#14757] php 7.1 and /usr/local/lib/php/Services/Weather.php:167
Summary php 7.1 and /usr/local/lib/php/Services/Weather.php:167
Queue Horde Framework Packages
Type Bug
State Not A Bug
Priority 1. Low
Owners
Requester dpa-bugs (at) aegee (dot) org
Created 12/23/2017 (2728 days ago)
Due
Updated 12/24/2017 (2727 days ago)
Assigned
Resolved 12/24/2017 (2727 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
12/24/2017 04:55:07 AM Michael Rubinsky Comment #3
State ⇒ Not A Bug
Reply to this comment
...and a duplicate of literally dozens of mailing list posts and bug reports.
12/23/2017 09:35:33 PM arjen+horde (at) de-korte (dot) org Comment #2 Reply to this comment
Services_Weather is not a Horde package and is not supported in PHP7. 
See https://pear.php.net/package/Services_Weather/

Also, see the comment for https://bugs.horde.org/ticket/14756 which 
also applies here.
12/23/2017 09:24:03 PM dpa-bugs (at) aegee (dot) org Comment #1
Priority ⇒ 1. Low
Patch ⇒ No
Milestone ⇒
Queue ⇒ Horde Framework Packages
Summary ⇒ php 7.1 and /usr/local/lib/php/Services/Weather.php:167
Type ⇒ Bug
State ⇒ Unconfirmed
Reply to this comment
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

Saved Queries