3v4l.org

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

preferences:
179.2 ms | 1395 KiB | 60 Q