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
1 answer

How to manage includes, require and use in this project

In this PHP project without framework, I have this folder structure: Adapter, Class and Models A php file "index.php" is executed from the root and I have problems handling the model and adapter classes Index file
ilernet2
  • 115
  • 1
  • 1
  • 7
0
votes
1 answer

how to show databases name in codeigniter 3

hy everyone, can I get list of databases name in mysql server on codeigniter3 I have tried this codeigniter3 query code but still not worked: $databases = $this->db->query('show databases'); I also tried with php code not worked $db_conn =…
arjilm
  • 71
  • 2
  • 6
0
votes
1 answer

GraphQL Schema not Loaded on Heroku

Has anyone used this GraphQL Laravel Library before? I managed to get it working on my local machine. But when I deploy it to Heroku, I keep getting an error that my schema is not loaded. How do I resolve this? Here's a screenshot of my local…
Davina Leong
  • 737
  • 2
  • 11
  • 28
0
votes
1 answer

What will be the alternative of arrayObject()?

During migration of my code from PHP5 to PHP7, I am facing some pretty issues, One of them are arrayObject(). arrayObject in PHP7 is not behaving as expected, what will be the alternate solution to achieve arrayObject functionality. //I have some…
MoS
  • 11
  • 1
0
votes
1 answer

Pass parameter from URL to controller function with correct type in CakePHP

I am developing a RESTful API using PHP 7 and CakePHP 4.0.
mrodo
  • 565
  • 5
  • 21
0
votes
1 answer

Imagick function that works on one server and doesn't work on another

I have a problem moving my script from one server to one other. The PHP script read a PDF file and create an image for each page of the pdf. This script currently works in an environment that has these characteristics PHP version: 7.4.8 Imagick…
0
votes
0 answers

PHP - include and fopen

I have a small script that if you run it locally (windows) or on the server where I have deployed the code, it works fine. It does 2 things, on the one hand I include some of its own classes and on the other hand I make a "fopen" of an html file in…
ilernet2
  • 115
  • 1
  • 1
  • 7
0
votes
1 answer

PHPgraphlib PHP Warning count() Parameter must be an Array or Object (line 926)

I use PHPgraphlib for many years and like that it generates a reliable image instead of some fancy Javascript-stuff. Now since update to PHP7, it renders a log-error on line 926 of the original code: PHP Warning: count(): Parameter must be an array…
Juergen
  • 11
  • 2
0
votes
1 answer

Find out the name of the last script that included the current one

Let's say I have 3 scripts, the main/top one which includes second which in turn includes a third. Let me draw that so it be clear. [top level script] -> [second level script] -> [third level script] So, is there a easy way to get a name of the…
0
votes
0 answers

How to remove null from object array in php?

I have an arrayof objects like [ null, { "list_type": 1, "list_item": { "id": 21, "name":"aaa" } }, null, null, { "list_type": 0, "list_item": { "id": 24, "name":"bbb" } } ] I want to remove the…
Jyothi
  • 53
  • 8
0
votes
1 answer

Create multidimensional array based on value

I've spent hours trying to find the answer to this question, but I'm struggling. I'm reasonably familiar with PHP and the various in-built functions, and can build a complex foreach() loop to do this, but I thought I'd ask to see if anyone has a…
Rohit Kaushik
  • 1,182
  • 12
  • 18
0
votes
2 answers

PHP list() expects numerical indexes in v7.4.6

In the PHP manual, I read: Before PHP 7.1.0, list() only worked on numerical arrays and assumes the numerical indices start at 0. My code: echo 'Current PHP version: ' . phpversion() . "\n" ; print_r( $Item ) ; list( $Cost, $Quantity, $TotalCost )…
carlo.borreo
  • 1,344
  • 2
  • 18
  • 35
0
votes
0 answers

ErrorException : Attempt to read property "key" on string Laravel 8 Image Upload Error

/** * A function to update single image. Params are filename, name, directory, the image file, old images */ static function singleUploadUpdate($filename, $directory, $file, $data){ $dir =…
Tugrul Yildirim
  • 329
  • 2
  • 8
0
votes
1 answer

How to sort values Alphabetically in php on click

I have a parent class which is loading the data from Dataset. Child class is accessing the values and printing them in a table. There are 10 rows with name, surname and more. I would like to sort name values when someone click on name using…
Qasim Ali
  • 587
  • 2
  • 11
  • 28
0
votes
1 answer

I am Stuck with the error Class 'Mpdf\Mpdf' not found -php pdf creation

i've installed mpdf library with command composer require mpdf/mpdf.And it is installed in the location vendor/mpdf/src/Mpdf.php. And composer_autoload is true in config\autoload.php. with the below code, am getting the error Class 'Mpdf\Mpdf' not…
user17699125