Late Static Bindings in PHP
by TechVidvan Team
Program 1
<html>
<head><title>Demo</title></head>
<body>
<center>
<?php
class First
{
protected static $username="Vikas Sharma";
function display()
{
echo static::$username;
}
}
class Second extends First
{
protected static $username="Rahul Gupta";
}
$f=new First();
$f->display();
$s=new Second();
$s->display();
?>
</center>
</body>
</html>
Tags: late static bindingslate static bindings in phpPHPphp late static bindingsphp late static bindings with examplesphp practicalphp program
TechVidvan Team
TechVidvan Team provides high-quality content & courses on AI, ML, Data Science, Data Engineering, Data Analytics, programming, Python, DSA, Android, Flutter, full stack web dev, MERN, and many latest technology.