3v4l.org

run code in 300+ PHP versions simultaneously
<?php $obj = new ninja(); $color = 'black'; print_r($obj->{$color.'_field'}); $val = $obj->{$color.'_method'}('sup'); print_r($val); $color = 'white'; print_r($obj->{$color.'_field'}); $val = $obj->{$color.'_method'}('sup'); print_r($val); class ninja { public $black_field = array('black ninja'); public $white_field = array('white ninja'); public function black_method($param) { return $param.' in black method'; } public function white_method($param) { return $param.' in black method'; } } ?>
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => black ninja ) sup in black methodArray ( [0] => white ninja ) sup in black method

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