php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75847 Strange behaviour of array_map and call_user_func_array
Submitted: 2018-01-19 07:15 UTC Modified: 2018-01-19 23:02 UTC
From: lumi at centrum dot cz Assigned: cmb (profile)
Status: Wont fix Package: *General Issues
PHP Version: 5.6.33 OS: ubuntu
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2018-01-19 07:15 UTC] lumi at centrum dot cz
Description:
------------
At one hosting that I have paid is installed this version of PHP:
PHP Version 5.6.33-1+ubuntu16.04.1+deb.sury.org+1 (from https://launchpad.net/~ondrej/+archive/ubuntu/php/+build/14218828)
online phpinfo located here: http://download.navrat.name/banan/phpinfo.php

When I tried deploy Nette Application to this server I got errors. After analyzing it looks for me that it is probably bug in the PHP or hosting configuration. 
On windows 5.6.33 x64-vc11-ts it works as expected. on another hosting with linux and version 5.5.38 or 5.6.31 it works too.
I'm trying to solve it with hosting, but there is horrible technical support:( So no possibility to get backtrace from them. They said that have the newest version of PHP and nobody reports error till now and everything works. That don't want to try this script by own.

In zip file at http://download.navrat.name/banan/bug-php5.6.zip is located output of phpinfo.php of this hosting and windows localhost to compare versions.  Zip file contains original exception error from Nette.
Same directory where is located zip file contains pictures with expected and actual output.

Test script contains 4 examples.
1 not working code with callback for array_map expected same/similar output as in 2.
2 working code with direct call of class_exists
3 working code with direct call of preg_replace_callback
4 not working code with call preg_replace_callback with call_user_func_array expected same output as in 3.
See follow up section with link to pictures.

I don't know if it is core PHP bug or some configuration hosting bug or some packaging.

I tried at discuss it with hosting - no success
then I tried create issue on package deb package creator: https://github.com/oerdnj/deb.sury.org/issues/788 and he thought that isn't package replated and recommend create issue here.

Test script:
---------------
Test script is located here: 
http://download.navrat.name/banan/test.php.txt 
resp.  
http://download.navrat.name/banan/test.php 
as executable version without first two lines that enable error/warning output.

Expected result:
----------------
another hosting company php 5.5.38
http://download.navrat.name/banan/lezeni-test-pipni-updated.png
or development machine windows php 5.6.33
http://download.navrat.name/banan/lezeni-test-localhost-updated.png

Actual result:
--------------
paid hosting
http://download.navrat.name/banan/lezeni-test-banan-updated.png
same hosting just enabled display_errors
http://download.navrat.name/banan/lezeni-test-banan-errors-enabled.pnp.PNG

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-01-19 14:48 UTC] lumi at centrum dot cz
online call of phpinfo and test.php Are irelevant now. Hosting migrated me back to 5.4 where this test code is working.
 [2018-01-19 23:02 UTC] cmb@php.net
-Status: Open +Status: Wont fix -Assigned To: +Assigned To: cmb
 [2018-01-19 23:02 UTC] cmb@php.net
Active support PHP 5.6 has ended a year ago[1].  Unless this issue
would affect an actively supported version, it won't get fixed.

[1] <http://www.php.net/supported-versions.php>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 16:01:31 2024 UTC