Questions tagged as 'php-7'

4
answers

What is the "spaceship operator" of PHP7?

I was checking out the New Features of PHP 7 and I came across an operator, which I had never seen in any programming language. The PHP Manual has demon- strated it from Spaceship Operator . I'll show you what I've seen below: echo...
asked by 16.09.2015 / 17:48
4
answers

Return typing in PHP 7. What are the advantages?

I was giving a test in PHP 7 and checked that it now accepts to define which type of data is going to be returned. Here are some tests: Defining the instance to be returned function test_object(): stdClass { return new ArrayObject;...
asked by 21.10.2015 / 17:33
2
answers

PHP 7 has typing arguments and return, but is optional. this is good or bad?

I would not like to raise a controversial issue here about the PHP 7 language, which was recently released, but only to understand some points about typing. Come on: In versions prior to PHP 7, the functions do not have return typing. We h...
asked by 11.01.2016 / 14:19
2
answers

PHP7 already has stable version for production?

I'm thinking of building a new version of my company's current system, it's with PHP in version 5.5.9. I would like to know if PHP 7 already has stable version to work in production, I saw many posts on the internet no one else spoke of sta...
asked by 15.12.2016 / 18:43
2
answers

What is the function of the "??" operator (two questions) in PHP?

Looking at a script PHP at some point I came across this line $valor = $_GET['id'] ?? 1; What is the interpretation of this code? What does it do?     
asked by 20.09.2017 / 15:51
2
answers

Which IDE is supported by PHP 7?

Does anyone know of any IDE (or simpler code editor) with PHP 7 support? I use NetBeans, but it looks like PHP 7 support on it may be added in future releases, but that's still unclear. I'm looking for an IDE or code editor that has PHP 7...
asked by 08.02.2016 / 20:42
1
answer

PHP 7 - Why does a method that returns the primitive type String, does not generate error when returning a Boolean value?

PHP 7 - Why does a method that returns the String primitive does not generate an error returning a Boolean value? <?php class Foo { public function bar() : string { return true; } } $Foo = new Foo(); echo $Foo->b...
asked by 08.08.2018 / 18:42
2
answers

PHP7 anonymous class. What are the advantages?

According to the PHP Manual , from the PHP 7 version you can define anonymous classes. Example: class SomeClass {} interface SomeInterface {} trait SomeTrait {} // Instanciamos a classe anonima aqui: var_dump(new class(10) extends SomeC...
asked by 10.09.2015 / 18:29
2
answers

What is the name of the operator ... used in PHP 5.6?

From PHP 5.6 we now have the possibility to invoke or declare a function, stating that the arguments are infinite, using the ... operator. Example: function add(... $arguments) { return array_sum($arguments); } add(1, 2,...
asked by 16.09.2015 / 17:55
2
answers

Show Total Records

Personal Talk, I am developing a system for videoconferences and this should include a Dashboard with some information, such as the total of videoconferences of the current day, the next day and the amount of VIP videoconferences. To show the...
asked by 22.07.2018 / 16:58