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
0 answers

PFBC script not working after migrating from PHP5 to PHP7 (Array to string conversion)

I had a very old script originally written in PHP5 that was using the PFBC library (https://code.google.com/archive/p/php-form-builder-class/). The machine was working untocuhed since 2014, but the time has came to replace it. However, the script is…
0
votes
1 answer

Apache2 2.4 not executing PHP 7.4 code, module not showing up

I have Apache2 running on a Debian 11 box (x64). It was installed with an Openmediavault ISO, with nginx and PHP 7.4 installed already (for the web UI) I try to install the PHP connector for apache2 (libapache2-mod-php7.4), and it installs fine, but…
0
votes
1 answer

Update key value in array of objects php

I have an array of objects where the reference is not the same as the code_cip. Array ( [9921279] => lignecatalogue Object ( [id] => 3013181 [reference] => 9921279 [commentaire] => [code_cip] => 9884064 ) [9884064] => lignecatalogue Object ( [id]…
Rohan
  • 3
  • 1
0
votes
1 answer

Convert many:many response into single objects

I have defined a users table, a roles table and a user_role pivot in my database. The model for the user is as follows:
cross19xx
  • 3,170
  • 1
  • 25
  • 40
0
votes
1 answer

How to use an anonomyous function directly to assign a value?

I know I can do this: $myFunc = function () { return 42; }; $val = $myFunc(); But I want to skip $myFunc and do something like this: $val = () { return 42; }; Is this possible? Of course, my real function is more complicated. It looks like…
klutt
  • 30,332
  • 17
  • 55
  • 95
0
votes
0 answers

php7 compatibility: Uncaught Exception: Error

can you help me update this script for compatibility with php7? I get error: Uncaught Exception: Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line…
k4mk4m
  • 1
  • 1
0
votes
0 answers

database connection error message not woking

Please, can I know what's wrong with this function. I want if the connection to database is not established to display a custom error message instead of the default exeption.
0
votes
1 answer

Sessions not working on CDN but works on localhost

Code works well on localhost, but when i deployed it on hosting that is using CDN, the PHP session is not working. On page1, I have form that is using token
Sam San
  • 6,567
  • 8
  • 33
  • 51
0
votes
1 answer

Run jobs one after another in Laravel 8

I'm trying to automate a process composed from multiple jobs. Every job had a goal, so I'm running a global job who is responsible for creating child jobs. - Job-1 Global Job -> - Job-2 - Job-3 -…
KubiRoazhon
  • 1,759
  • 3
  • 22
  • 48
0
votes
1 answer

Laravel - Passing data from multiple methods from the same controller to a partial view

I have a simple phone book application with a main view, index.blade.php that includes a partial view, contact_list.blade.php. I only have a single route that refers to my controller, ContactListController.php. From inside contact_list.blade.php I…
Laila Campos
  • 801
  • 1
  • 8
  • 21
0
votes
1 answer

Laravel 8 - htmlspecialchars() expects parameter 1 to be string, object given

I'm trying to access a Controller method from inside my view, but I'm getting this error: htmlspecialchars() expects parameter 1 to be string, object given (View:…
Laila Campos
  • 801
  • 1
  • 8
  • 21
0
votes
2 answers

Laravel - PDOException::("SQLSTATE[42S02]: Base table or view not found: 1146 Table 'vestibulare.app\models\telefone' doesn't exist

I'm new to Laravel. I'm trying to access some data from within a partial view. I tried to put my query inside the boot method of AppServiceProvider, but Im getting this error: PDOException::("SQLSTATE[42S02]: Base table or view not found: 1146 Table…
Laila Campos
  • 801
  • 1
  • 8
  • 21
0
votes
1 answer

Run phpunit with custom php path

I'm working on Redhat server, I'm going to add unit test (PHPUnit) to an existing application, PHP is installed on custom path /logi/php7211 (I shouldn't change any configuration), when I run the command php -v I get -bash: php : commande…
0
votes
0 answers

Installing PHP 7.4 manually (offline) on Linux Red Hat server

I have upgraded from PHP 5.3 to PHP 7.2 and the application is working. now I want to upgrade to PHP7.4, when I run the command './configure' '--prefix=/logi/php746' '--bindir=/logi/php746/bin' '--with-config-file-path=/logi/php746'…
0
votes
0 answers

phpMyAdmin does not respond to clicks

My phpMyAdmin web-interface is loaded properly, login OK, I can see a standard post-login screen with all database names etc., but when I left-click on anything - nothing works. I can't even logout. Google Chrome console contains the following…
sda
  • 143
  • 1
  • 10