3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait SafeAccess { public function __set($name, $value) { throw new \Exception("Property [$name] doesn't exist for class [".get_class($this)."] so can't set it"); } public function __get($name) { throw new \Exception("Property [$name] doesn't exist for class [".get_class($this)."] so can't get it"); } public function __call($name, $arguments) { throw new \Exception("Method [$name] doesn't exist for class."); } } class foo { use SafeAccess; public function __construct() { $this->uwotm8 = true; } } new foo();
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
Fatal error: Uncaught Exception: Property [uwotm8] doesn't exist for class [foo] so can't set it in /in/vkiD7:5 Stack trace: #0 /in/vkiD7(21): foo->__set('uwotm8', true) #1 /in/vkiD7(26): foo->__construct() #2 {main} thrown in /in/vkiD7 on line 5
Process exited with code 255.
Output for 5.5.0 - 5.5.35, 5.6.0 - 5.6.28
Fatal error: Uncaught exception 'Exception' with message 'Property [uwotm8] doesn't exist for class [foo] so can't set it' in /in/vkiD7:5 Stack trace: #0 /in/vkiD7(21): foo->__set('uwotm8', true) #1 /in/vkiD7(26): foo->__construct() #2 {main} thrown in /in/vkiD7 on line 5
Process exited with code 255.

preferences:
113.9 ms | 1822 KiB | 4 Q