I would like to know if there is, in PHP, some magic method that is invoked when a constant doesn't exist. I know __callStatic() is invoked when a static method doesn't exist, but what about constant, is there anything?
<?php
class Pizza
{
const QTD_PIECES_LARGE = 8;
const QTD_PEDACO_MEDIUM = 4;
private $name;
public function getName()
{
return $this->name;
}
public function setName($name)
{
$this->name = $name;
}
}
echo 'The number of pieces of the small pizza is:',Pizza::QTD_PIECE_LITTLE;
?>
I was wondering if there is any magic that I can invoke when the method happens to call this constant that doesn't exist?
Remembering that the code is fake, just to exemplify what I want. And I used google translate
Thanks!