3v4l.org

run code in 300+ PHP versions simultaneously
<?php class NumberValue { protected $m_unitin = false; } class QuantityValue extends NumberValue { public function __construct() { $this->setUnit(); } protected function setUnit() { assert( '$this->m_unitin' ); $this->m_unitin = 'K'; } public function getUnit() { return $this->m_unitin; } } $quantityValue = new QuantityValue(); echo( $quantityValue->getUnit() );

preferences:
58.25 ms | 402 KiB | 5 Q