3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class first { protected $someArray = array(); } class second extends first protected $someArray = array(); protected $someValue = null; public function __construct($someValue) { $this->someValue = $someValue; } } $objFirst = new second('123'); $objSecond = new second('321'); var_dump($object1 == $object2); print_r($object1); print_r($object2); var_dump($object1 == $object2);
Output for 5.4.0 - 5.4.23
Parse error: syntax error, unexpected 'protected' (T_PROTECTED), expecting '{' in /in/ceGkW on line 13
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_PROTECTED, expecting '{' in /in/ceGkW on line 13
Process exited with code 255.

preferences:
170.42 ms | 1395 KiB | 60 Q