3v4l.org

run code in 300+ PHP versions simultaneously
<?php ob_start(function ($buffer) { // return ''; throw new \Exception('x'); }); echo 5; try { ob_flush(); } catch (\Exception $e) { echo $e; }
Output for 8.4.1 - 8.4.14
5Exception: x in /in/kQMfY:5 Stack trace: #0 [internal function]: {closure:/in/kQMfY:3}('5', 5) #1 /in/kQMfY(11): ob_flush() #2 {main}
Output for 7.4.0 - 7.4.33, 8.0.1 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.27
5Exception: x in /in/kQMfY:5 Stack trace: #0 [internal function]: {closure}('5', 5) #1 /in/kQMfY(11): ob_flush() #2 {main}

preferences:
97.68 ms | 408 KiB | 5 Q