3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ErrorReportingSwitcher { private $old_flags; public function __construct( $flag_add, $flag_remove = 0 ) { echo __METHOD__ . PHP_EOL; $this->old_flags = error_reporting(); $new_flags = $this->old_flags; if ( $flag_add != 0 ){ $new_flags |= $flag_add; } if ( $flag_remove != 0 ){ $new_flags &= ~$flag_remove; } error_reporting($new_flags); } public function __destruct() { echo __METHOD__ . PHP_EOL; if ( $this->old_flags ){ error_reporting( $this->old_flags ); } } } function hoge() { echo "start\n"; new ErrorReportingSwitcher(0,E_STRICT); // strict warningが発生する処理 echo "end\n"; } hoge();
Output for git.master, git.master_jit, rfc.property-hooks
start ErrorReportingSwitcher::__construct ErrorReportingSwitcher::__destruct end

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
51.02 ms | 401 KiB | 8 Q