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

Check method in method exists or is not null

Is there a better way to check all this in less lines of code? if ( $item->getProduct() !== null && $item->getProduct()->getMedia() !== null && $item->getProduct()->getMedia()->count() &&…
wormhit
  • 3,687
  • 37
  • 46
0
votes
0 answers

PHP code getting printed in browser on runnning Apache Web App

I am using php 7 and Apache 2 for running my local web server. I am, however, facing a weird issue of php code getting printed on the browser instead of it getting executed. I have tried all the suggested fixes I could find online but none of them…
0
votes
1 answer

PHP - Type Hint A More Specific Type When Implementing An Interface

Given an object/interface hierarchy like the following
Pedro del Sol
  • 2,840
  • 9
  • 39
  • 52
0
votes
1 answer

array_multisort on multibyte and ascents

I'm using array_multisort to sort the array like this. It is working well until some ascent characters are present. The sorting is treating the ascents as a separate letter and its giving incorrect results (É and E should be treated as same letter…
Linga
  • 10,379
  • 10
  • 52
  • 104
0
votes
1 answer

Laravel - Tinker breakpoint in controller

New to Lavarel. I am trying to debug a controller's method in Laravel, to do so I'm using Tinker (which is based on Psysh). I added both of these versions to the breakpoint inside the method signup of my…
Chayemor
  • 3,577
  • 4
  • 31
  • 54
0
votes
1 answer

PHP Closure - Return an array with key / value

I use DomCrawler to grab some data, and I would like to know if I can get an array from a closure, here is my code : $promises = $products ->each(function(Crawler $node) use ($client, $cookieJar) { $href =…
Vincent Decaux
  • 9,857
  • 6
  • 56
  • 84
0
votes
0 answers

PHP: Unable to decrypt AES 128 CBC

I have a string encrypted in AES 128 + Zero Padding + IV and CBC mode. About zero padding, if the length is not 128bit, the encryption will fill the remaining part 0x00 and reach 128 bit. An IV value can be specified successfully only if both IV…
Lynob
  • 5,059
  • 15
  • 64
  • 114
0
votes
1 answer

Heirarchial Category menu breaking when added to view though AppServiceProvider.php

thanks for any input you all can give me on my problem. Long time lurker but this is my first post because honestly every question i have had about Laravel has been quickly solved with the abundance of info here and on stack overflow. Let me first…
Mike Lucid
  • 1,344
  • 13
  • 26
0
votes
1 answer

How To Connect PHP7.3, sql server & Nginx Debian10

Please help me.... I've created a web server using OS Debian 10, Nginx and PHP7.3 and everything is running well. but when it will connect to the sql server, it cannot connect. I've done several tutorials such as: pecl install sqlsrv…
0
votes
1 answer

Can't connect to MS SqlServer using php

I am trying to connect to an external db which uses sqlserver but after trying many options couldnt find one that works at all. $connattempt1 = odbc_connect("Driver={SQL Server Native Client…
Mbotet
  • 170
  • 2
  • 17
0
votes
0 answers

How to create DateTime from a Unix timestamp with milliseconds?

How to create DateTime from a Unix timestamp with milliseconds? Such as 1612119630095.
Alex P.
  • 3,697
  • 9
  • 45
  • 110
0
votes
2 answers

Strange problem: PHP returns wrong easter date this year

I need the current Easter date this year in my code. Easter 2021 this year will be observed on Sunday, April 4. But when I run echo date('Y-m-d',easter_date(2021)); PHP returns: 2021-04-03 How is that possible? What's wrong?
angelique000
  • 899
  • 3
  • 10
  • 28
0
votes
0 answers

Is it possible to modify core class in PHP?

I have to work with low-quality legacy PHP code. Because of poor architecture and exception handling, often happens, that an error (core \Exception or \RuntimeException or \TypeError) is thrown and caught at some moment, but ignored and instead…
Oleksandr Boiko
  • 182
  • 3
  • 9
0
votes
1 answer

how to get json values ​in url with php

I am trying to send json values ​​with a url by POST but I am not getting any value. local test: http://127.0.0.1/test.php with postman I send inside the body: key: Token Value: xxyyz my service…
Leoh
  • 642
  • 2
  • 17
  • 41
0
votes
2 answers

Zend Framework saving emojis as question marks in SQL Table

We are (still) using ZF1, to write/read from a Microsoft SQL database. As long as a table field is of type NVARCHAR, everything is fine, special characters (like, chinese, polish, etc.) and emojis are saved correctly, 1:1 equal to the entered text…
user3033043
1 2 3
99
100