<?php
declare(strict_types=1); // so only PHP 7 will show up
class FooBar {
private $x;
public function __construct() {
var_dump($this);
unset($this->x); // I can remove a property!
var_dump($this->x); // It's gone!
$this->x = 2; // I can recreate a property!
var_dump($this->x); // The "new" property retains the "old" property's visibilty. Good job.
}
}
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
Warning: Unsupported declare 'strict_types' in /in/7eaoc on line 3