<?php
class Student{
public $name;
public function describe(){
echo "I am a student";
}
public function __get($pm){
echo "$pm does not exist";
}
public function __set($pm, $value){
echo "We set $pm->$value";
}
public function __call($pm, $value){
echo 'There is no <b>'.$pm.'</b> method and arguments:'.implode(', ', $value);
}
}
$st = new student();
$st->describe();
$st->Hasan;
$st->age = 15;
$st->notExistmethod('2','8','5');
?>
I am a studentHasan does not existWe set age->15There is no <b>notExistmethod</b> method and arguments:2, 8, 5
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
I am a studentHasan does not existWe set age->15There is no <b>notExistmethod</b> method and arguments:2, 8, 5