3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Registry { public $data = []; public function __get($var) { return $this->data[$var] ?? null; } public function get($var, $default) { if (!array_key_exists($var, $this->data)) { return $default; } } } $reg = new Registry; var_dump($reg->empty); var_dump(strtoupper($reg->empty)); var_dump($reg->get('empty', 'empty')); var_dump(strtoupper($reg->get('empty', 'empty')));
Output for git.master_jit, git.master, rfc.property-hooks
NULL Deprecated: strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated in /in/s9DIE on line 25 string(0) "" string(5) "empty" string(5) "EMPTY"

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:
26.92 ms | 405 KiB | 5 Q