#[ReturnTypeWillChange] Is For All

5 months ago by exakat to c/php

``ReturnTypeWillChange`` is an attribute that tells PHP that the return type of the related method is different from the defined by the PHP native methods
psion1369 3 points 5 months ago

All the work to make PHP type safe and then we introduce this bullshit.

path: 0 22808974, hotness: undefined, score: 3, children: 0
Arcanoloth 1 point 5 months ago

Ewww.

path: 0 22808393, hotness: undefined, score: 1, children: 0
exakat 1 point 5 months ago

#[ReturnTypeWillChange] is actually for PHP native interfaces, as they were initialy not enforced, until they were. It happens to apply to custom methods too. May be static analysis should report such usage, as it is probably a code smell.

path: 0 22810397, hotness: undefined, score: 1, children: 0
php
php

@lemmy.world

login for more options
430
202
59

<?

namespace lemmy\php;

/*

Welcome to the PHP community on Lemmy

#Rules:

1: Soon(TM)

#Helpful stuff:

PHP Documentation

Composer

PHP Standards

#Common frameworks:

Symfony

Larvel

*/

echo "Welcome";

go to feed...