3v4l.org

run code in 300+ PHP versions simultaneously
<?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'); ?>
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
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

preferences:
152.59 ms | 402 KiB | 173 Q