3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test = '1234'; $failed = false; try{ $testcopy = $test; $testcopy = str_replace( '1' ); }catch(Exception $e){ $failed = true; } if ( ! $failed ) { $test = $testcopy; } var_dump ($test);

preferences:
35.24 ms | 402 KiB | 5 Q