3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* Output: g 1024 error f 1024 error f 1024 error Expected Output: g 1024 error f 1024 error g 1024 error f 1024 error */ var_dump(set_error_handler('f')); $error_handler = set_error_handler('g'); var_dump($error_handler); trigger_error('error'); trigger_error('error'); function f($errno, $errstr) { echo 'f ' . $errno . ' ' . $errstr . "\n"; } function g($errno, $errstr) { echo 'g ' . $errno . ' ' . $errstr . "\n"; var_dump(set_error_handler('h')); var_dump(restore_error_handler()); global $error_handler; var_dump($error_handler); call_user_func($error_handler, $errno, $errstr); } function h($errno, $errstr) { echo 'h ' . $errno . ' ' . $errstr . "\n"; }
Output for rfc.property-hooks, git.master, git.master_jit
NULL string(1) "f" g 1024 error NULL bool(true) string(1) "f" f 1024 error g 1024 error NULL bool(true) string(1) "f" f 1024 error

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:
95.94 ms | 2679 KiB | 4 Q