3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Cat { protected $isFloof; protected $isEvil; public function __construct() { $this->isFloof = true; $this->isEvil = true; } } $cat = new Cat(); if ($cat->isEvil) { echo "run"; }
based on dSJag
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Cannot access protected property Cat::$isEvil in /in/XJoFQ:17 Stack trace: #0 {main} thrown in /in/XJoFQ on line 17
Process exited with code 255.
Output for 5.3.22 - 5.6.28
Fatal error: Cannot access protected property Cat::$isEvil in /in/XJoFQ on line 17
Process exited with code 255.