3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Fruits { public $fruits = 'grape '; public function output_fruits_name() { return 'lemon '; } function test() { echo $this->fruits; echo $this->output_fruits_name() ; } } $obj = new Fruits(); $obj->test(); ?>
Output for 8.0.1 - 8.0.27, 8.1.0 - 8.1.14, 8.2.0 - 8.2.1
grape lemon

preferences:
17.46 ms | 406 KiB | 5 Q