3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = [1, 5, 8]; $s = 'Hello'; $o = new stdClass(); $spl = new SplFixedArray(5); var_dump(isset($s[$o])); var_dump(empty($s[$o])); try { $s[$o] = 'A'; } catch (\Throwable $e) { echo $e->getMessage(), "\n"; } try { var_dump($s[$o]); } catch (\Throwable $e) { echo $e->getMessage(), "\n"; } try { var_dump(isset($a[$o])); } catch (\Throwable $e) { echo $e->getMessage(), "\n"; } try { var_dump(empty($a[$o])); } catch (\Throwable $e) { echo $e->getMessage(), "\n"; } try { $a[$o] = 'AAAAAAAAAAAAA'; } catch (\Throwable $e) { echo $e->getMessage(), "\n"; } var_dump(isset($spl[$o])); var_dump(empty($spl[$o])); try { $spl[$o] = 'AAAAAAAAAAAAA'; } catch (\Throwable $e) { echo $e->getMessage(), "\n"; }
Output for git.master, git.master_jit
bool(false) bool(true) Cannot access offset of type stdClass on string Cannot access offset of type stdClass on string Illegal offset type in isset or empty Illegal offset type in isset or empty Illegal offset type Fatal error: Uncaught TypeError: Illegal offset type in /in/YhEYe:38 Stack trace: #0 {main} thrown in /in/YhEYe on line 38
Process exited with code 255.
Output for rfc.property-hooks
bool(false) bool(true) Cannot access offset of type stdClass on string Cannot access offset of type stdClass on string Cannot access offset of type object in isset or empty Cannot access offset of type object in isset or empty Cannot access offset of type object on array Fatal error: Uncaught TypeError: Cannot access offset of type object on FixedArray in /in/YhEYe:38 Stack trace: #0 {main} thrown in /in/YhEYe on line 38
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:
19.6 ms | 401 KiB | 8 Q