Questions tagged [php-5.6]

PHP 5.6 was the successor to PHP 5.5. It was released on August 24, 2014 and reached end-of-life on December 31, 2018. Use this tag for version-specific issues relating to specifically to PHP 5.6.

PHP 5.6.0 came with new features such as (incomplete list):

  • Constant scalar expressions
  • Variadic functions
  • Argument unpacking
  • Support for large(>2GiB) file uploads
  • SSL/TLS improvements
  • New command line debugger called phpdbg

See Migrating from PHP 5.5.x to PHP 5.6.x for more information.

Information

  • If you want to talk about PHP or if you have a question, you can come to Chat Room 11: PHP.
  • For global question on PHP, please use the generic tag:
886 questions
4
votes
2 answers

Mismatch between php version and php-config version

I am using Ubuntu 14.04. Recently, I updated from php5.5 to php5.6 following this link:https://www.dev-metal.com/install-setup-php-5-6-ubuntu-14-04-lts/ (i.e. adding the ppa:ondrej/php5-5.6 repository) After that php-config --version is showing…
Raghuram Vadapalli
  • 1,190
  • 2
  • 13
  • 27
4
votes
3 answers

Telegram + PHP (Windows 7): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found

I'm trying to move my first steps in Telegram and I'm also a newbie in PHP ...... I've configured, on my Windows 7 pc, Apache 2.4 with PHP 5.6.14 and SSL and it's working fine in http and https. Then I've tried to follow this Telegram Bot Tutorial…
Cesare
  • 1,629
  • 9
  • 30
  • 72
4
votes
2 answers

PHP reference - The confusions

I find that the reference in the code below is confusing, $a = 4; $b = &$a; var_dump($b); $a = 10; var_dump($b); // 10 $b = 100; var_dump($a); // 100 but shouldn't it be 10? Value of $b is a reference to $a and $a is never a reference to $b. But…
Run
  • 54,938
  • 169
  • 450
  • 748
4
votes
1 answer

Doctrine Caching - upgrading to PHP 5/6

I'm in the process of upgrading my server from PHP 5.4 to PHP 5.6. One of the performance enhancments I use is to cache Doctrine results: $query->useResultCache('cache_key', 300); I have Symfony configured to use APC for caching: doctrine: …
Steven Musumeche
  • 2,886
  • 5
  • 33
  • 55
4
votes
4 answers

Remove words from phrase and leave only one space between the words

I have the following phrase and I need in PHP to remove the English Characters $field = "日本語フレーズ A Japanese phrase A Japanese phrase 日本語フレーズ"; I have the following regular expression trim(preg_replace('/[a-zA-Z]/', '', $field)); but this will…
gmponos
  • 2,157
  • 4
  • 22
  • 33
4
votes
1 answer

Is there a way to update caller scope variables from php closure

use keyword with php closure is a pretty clear way to extend the scope of handpicked variable to closure. Is there any way if we need to update the value of some variable in caller function scope from closure? $total_strength =…
Shoaib Nawaz
  • 2,302
  • 4
  • 29
  • 38
4
votes
2 answers

PHP: Performance: splat operator or reflection

In an app that I'm creating, I need to pass an unknown number of parameters to an unknown constructor of a class. The class (+ namespace) is a string, that is in $class. The parameters are in an array. This application will be deployed over a couple…
Blaatpraat
  • 2,829
  • 11
  • 23
3
votes
1 answer

is there real 64bit version of PHP 5.6 for windows?

On 32bit php, the PHP_INT_MAX (max integer value) is much lower, and causes problems. When looking online to get local laragon test server up, found old versions for windows archived here: https://windows.php.net/downloads/releases/archives/ Problem…
PM_KLS
  • 53
  • 6
3
votes
3 answers

Implement Iterator interface for ArrayAccess without container array

This is my attempt at implementing https://www.php.net/manual/en/class.iterator.php for an ArrayAccess. Many examples use a container array as a private member variable; but I do not want to use a container array if possible. The main reason why I…
ParoX
  • 5,685
  • 23
  • 81
  • 152
3
votes
1 answer

array_column returning empty array in PHP 5.6

In a production environment that uses the Yii1 framework and PHP 5.6.40, the array_column function is returning an empty array. The array is a list of CActiveRecords from another CActiveRecord's HAS_MANY relation. On my local machine (PHP 7.1.23),…
hutch90
  • 341
  • 3
  • 15
3
votes
1 answer

When i use php setrawcookie function getting server error

I am facing strange issue, When I use setrawcookie function, I got error 502, setrawcookie("PVEAuthCookie", $vncproxy['ticket'], 0, "/",'mydomain.com', true); It's throw me 502 Bad Gateway nginx/1.11.5 error. I have PHP Version 5.6.40, Cookie…
3
votes
1 answer

How to execute a php file in background from another php file

I have two files, file_a.php and file_b.php. In file file_a.php, I'm trying to execute file_b.php as a "background process". I tried two ways I have found here on stackoverflow, but i can't make it work: file_a.php (exec solution) echo "Start…
user31929
  • 1,115
  • 20
  • 43
3
votes
1 answer

php:5-apache mcrypt.h not found

I work on some old project (Laravel 4.2) which use mcrypt and php5 and wanna run it on docker. Here is my dockerfile: FROM php:5-apache COPY --from=composer:latest /usr/bin/composer /usr/bin/composer RUN apt-get update &&\ apt-get install -y…
Kamil Kiełczewski
  • 85,173
  • 29
  • 368
  • 345
3
votes
0 answers

Only a small portion of the data is uploaded to the server - Ajax post request

I am using following ajax request to send data to my backend API (written in PHP). $.ajax({ url: '', type: 'POST', data:({ type: 'save', data: DATA }), ........ here, the "DATA" is a…
Chana
  • 56
  • 8
3
votes
4 answers

Accessing the property name of the first property in an stdClass in PHP

I have an array that consists of many stdClasses after doing a json_decode on a json string. It looks like this: product: array(3) 0: stdClass PropertyAbc: "Product 1|Product 5" 1: stdClass PropertyXyz: "Product 2|Product 9|Product 10" 2:…
Blake Rivell
  • 13,105
  • 31
  • 115
  • 231