Questions tagged [php-7]

PHP 7 is the successor to PHP 5.6, it was released on December 3, 2015. Use this tag for issues relating to development using PHP 7

PHP 7 is the next version of . It succeeds , which is the last release of the PHP 5.X version. PHP 7.0.0 was released on Dec 3, 2015

PHP 6

Several years ago there was a major push to make PHP Unicode compatible and this push focused around what was then slated to be PHP 6. An internal version was developed and a lot of material was published (including some books) about this new version. Serious problems with the implementation arose, however, and the project was abandoned, with most of the surviving code being implemented in PHP 5.4. To avoid confusion with this discussion the decision was made to skip version 6.

Development

You can download the PHP 7 source and compile it yourself. Official builds are available on the PHP website.

Features

New features of PHP 7 include (See all accepted features):

PHP7 migration guide

There's a whole section on Migrating from PHP 5.6.x to PHP 7.0.x in the manual:

© 1997-2015, The PHP Documentation group, CC-BY 3.0

Information

  • For global question on PHP, please use the generic tag:
  • If you want to talk about PHP or if you have a question, you can come to the PHP chat room
2761 questions
0
votes
2 answers

Sendy Cronjob failing again and again

I have currently installed sendy email sending script on amazon ec2 instance on php version 7. The problem I am facing is that whenever we create a new campaign the new campaign it simply shows pending and does not progresses. To resolve it I have…
COdeingNinja
  • 381
  • 5
  • 20
0
votes
2 answers

Symfony 5 use getDoctrine() in another Controller

I try to call "class CltvController" from another class like this : class StatLtvcController extends AbstractController { $cltv_temp = new CltvController(); return $this->render('admin/statltvc.html.twig', [ 'cltv_temp' => $cltv_temp->cltv(), …
0
votes
0 answers

PHP 7 to 8 migration, what to do with MB_OVERLOAD_STRING

I am trying to migrate php website from version 7 to 8. There is MB_OVERLOAD_STRING used, which is removed in PHP 8. What should I do to migrate it? Just replace all strpos, and other functions to mb_strpos or something else?
Zlelik
  • 559
  • 1
  • 7
  • 17
0
votes
0 answers

PHP session_start() no space left on device Debian 9.13

I have a PHP 7.4 application that runs on Debian 9.13 Stretch. If I run df -h I see the following result: Filesystem Size Used Avail Use% Mounted on udev 1.9G 0 1.9G 0% /dev tmpfs 386M 39M 347M 11%…
Pascut
  • 3,291
  • 6
  • 36
  • 64
0
votes
0 answers

PHP 5.5 vs 7.4 TTFB slower

I have recently copied my website to a other server (which performs way better than the old one). I am running 7.4 on that new website, but I noticed the Time to the First Byte went up from 200 ms to like 600ms. I thought it might be the server that…
Grumpymuppet
  • 101
  • 1
  • 6
0
votes
1 answer

Wordpress getblocks in editor is returning an error: ( 'core/editor' ).getBlocks` is deprecated

I'm using WordPress 5.7.2 (on Windows IIS). I'm trying to use the block editor to add a list of newest products, best selling or featured products - when I do I get the error: Error loading block:

There has been a critical error on this…

Mark Tait
  • 545
  • 3
  • 12
  • 22
0
votes
0 answers

Obfuscating the php code before deploying on Cpanel?

Is there any way to obfuscate the PHP code before deploying on the cpanel? Use case : The reason I am asking this is because if I give someone a script that he/she wants to use on their cpanel , i dont want them to be able to make changes or steal…
Umer
  • 183
  • 2
  • 16
0
votes
1 answer

"Unknown response prefix: 'H'" when connecting to redis in laravel

I have tried "telnet 12.123.123.123 80" and using redis-commander. Everthing works perfectly fine but when run the code, it shows "Unknown response prefix: 'H'". Here's my code: $redisResultData =…
0
votes
1 answer

PHP-Laravel redirect to root(/) from /index.php

I'm working on a larvel project where everything is fine when I enter the url(domain) without /index.php. Suppose my url is https://example.com. When I go to this url, everything works perfectly. But if I add /index.php at the last like…
Robin
  • 4,902
  • 2
  • 27
  • 43
0
votes
0 answers

Docker with Apache, PHP and Elasticsearch

I'm trying to get Elasticsearch connected on Docker. However it's not working. When doing the setup for Magento 2 it comes back with: Could not validate a connection to Elasticsearch. No alive nodes found in your cluster When I try curl…
0
votes
1 answer

Dividing elements in arrays on specific numbers

I have N arrays like this (4 in example but number can be different) k1 = [1,0,0,0,1,0,1] k2 = [0,1,1,0,1,0,1] k3 = [1,0,0,0,1,0,0] k4 = [0,0,0,0,1,1,1] I need to get the following arrays: k1 = [0.5,0,0,0,0.25,0,0.33] k2 = [0, 1,1,0,0.25,0,0.33] k3…
user2867504
  • 95
  • 1
  • 9
0
votes
1 answer

Random value while returning $_SERVER['HTTPS']

I've a strange comportement while i'm trying to detect if HTTPS is enabled or not: $ssl=(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http"); $expected=$ssl.'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; echo…
Amaury
  • 1
0
votes
1 answer

MongoDB: SSL/TLS handshake failed and No suitable servers found

So I've a bit of a problem relating to Mongo and SSL Certificates. NOT hosting the mongo instance (other answers aimed at self-hosters). The error am getting is: PHP Fatal error: Uncaught MongoDB\Driver\Exception\ConnectionTimeoutException: No…
Donal.Lynch.Msc
  • 3,365
  • 12
  • 48
  • 78
0
votes
2 answers

How to create recursive array from the loop PHP?

I have an array like below and its dynamic array. $array = [10,20,30,40,50]; I want to create an another array recursively using the above array values. Looks like below Array ( [10] => Array ( [20] => Array …
raheem.unr
  • 797
  • 1
  • 7
  • 16
0
votes
0 answers

php if behaves different in windows and linux

Recently I came to know that there is a slight difference in code behavior due to host platform. $result = Data::my_custom_function($data, 'id'); //comment : my_custom_function($array, $id) --- it will return either false or string based on business…