3v4l.org

run code in 300+ PHP versions simultaneously
<?php $v = 'init value';// あらかじめ外で変数を用意して $fn = function() use ($v) {// use することでクロージャ内で使えるようにすると if (false) { static $v = 'changed value';// ここの変数宣言が何故か有効になって $v の値が書き換わる static $z = 'undefined';// こっちはちゃんと無効化されて、$zは未定義変数のまま echo 'ここは走らない'; } echo ' $v: '.$v ."\n"; echo 'isset($z): '. var_export(isset($z), true) ."\n"; }; $fn();
Output for git.master, git.master_jit
$v: init value isset($z): false
Output for rfc.property-hooks
Fatal error: Duplicate declaration of static variable $v in /in/7ELQZ on line 5
Process exited with code 255.

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:
58.81 ms | 401 KiB | 8 Q