Answers for "php 8 "<?=""

PHP
5

php 8

latest version of php.
see new features at https://php.watch/versions/8.0
Posted by: Guest on October-25-2020
0

php 8

pub   4096R/70D12172 2017-04-14 [expires: 2024-04-21]
      Key fingerprint = 1729 F839 38DA 44E2 7BA0  F4D3 DBDB 3974 70D1 2172
uid                  Sara Golemon <[email protected]>

pub   rsa4096 2020-05-09 [SC] [expires: 2024-05-08]
      BFDD D286 4282 4F81 18EF  7790 9B67 A5C1 2229 118F
uid           [ultimate] Gabriel Caruso (Release Manager) <[email protected]>
sub   rsa4096 2020-05-09 [E] [expires: 2024-05-08]
Posted by: Guest on July-10-2021
0

php8

// php8 class and construct
class Point {
  public function __construct(
    public float $x = 0.0,
    public float $y = 0.0,
    public float $z = 0.0,
  ) {}
}
Posted by: Guest on December-16-2020
0

php8

// php8 is null or not
$country = $session?->user?->getAddress()?->country;

//-----------------------------
// php7 below.
$country =  null;

if ($session !== null) {
  $user = $session->user;

  if ($user !== null) {
    $address = $user->getAddress();
  
    if ($address !== null) {
      $country = $address->country;
    }
  }
}
Posted by: Guest on December-16-2020
-1

php 8 "<?="

<?= is a shorthand for <?php echo $a; ?>
Posted by: Guest on January-13-2021

Browse Popular Code Answers by Language