No, while a static variable will stay for the current request you'll need to add it to a session to persist it's value across requests.
Example:
session_start();
class Car {
public static $make;
public function __construct($make) {
self::$make = $make;
}
}
$c = new Car('Bugatti');
echo '<p>' . Car::$make . '</p>';
unset($c);
if (!isset($_SESSION['make'])) {
echo '<p>' . Car::$make . '</p>';
$c = new Car('Ferrari');
echo '<p>' . Car::$make . '</p>';
}
$_SESSION['make'] = Car::$make;
echo '<p>' . $_SESSION['make'] . '</p>';
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…