Сообщение от voraa
|
Это как?
|
http://sandbox.onlinephpfunctions.co...f43864b2b53300
<?php
abstract class AbstractHttpService {
protected string $baseRouteName;
public function __construct(?string $baseRouteName = null) {
if ($baseRouteName) {
$this->baseRouteName = $baseRouteName;
}
var_dump($this->baseRouteName);
}
}
class ProductsHttpService extends AbstractHttpService {
protected string $baseRouteName = 'product';
}
new ProductsHttpService();// string(7) "product"