3v4l.org

run code in 500+ PHP versions simultaneously
<?php class HelloWorld { public function text() { return "Hello World"; } public function helloWorld() { echo $this->text(); } } $helloWorld = new HelloWorld(); $helloWorld->helloWorld(); ?>
Output for 8.1.32 - 8.1.34, 8.2.0 - 8.2.31, 8.3.0 - 8.3.31, 8.4.1 - 8.4.22, 8.5.0 - 8.5.7
Hello World
Output for 7.4.33
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; HelloWorld has a deprecated constructor in /in/a8JYT on line 3 Hello WorldHello World

preferences:
62.38 ms | 868 KiB | 4 Q