3v4l.org

run code in 300+ PHP versions simultaneously
<?php define("TEST_STRING", "Hello World!"); class RequestObserver { public function __construct() { ob_start(); } public function __destruct() { $content = ob_get_flush(); if ($content == TEST_STRING) { echo PHP_EOL, "+ Test passed"; } else { echo PHP_EOL, "- Test failed:", PHP_EOL; var_dump($content); } } } $observer = new RequestObserver(); echo TEST_STRING;
Output for 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.29, 8.2.0 - 8.2.21, 8.3.0 - 8.3.9
Hello World! + Test passed

preferences:
232.86 ms | 404 KiB | 298 Q