3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class card { private $rank; private $suit; public function __construct($rank, $suit) { $this->rank = $rank; $this->suit = $suit; } public function getRank() { return $this->rank; } } $x = new card(1, 'a'); echo x.getRank(); ?>
based on sae6V
Output for 7.2.0
Warning: Use of undefined constant x - assumed 'x' (this will throw an Error in a future version of PHP) in /in/KgUbk on line 18 Fatal error: Uncaught Error: Call to undefined function getRank() in /in/KgUbk:18 Stack trace: #0 {main} thrown in /in/KgUbk on line 18
Process exited with code 255.
Output for 7.0.0 - 7.1.10
Notice: Use of undefined constant x - assumed 'x' in /in/KgUbk on line 18 Fatal error: Uncaught Error: Call to undefined function getRank() in /in/KgUbk:18 Stack trace: #0 {main} thrown in /in/KgUbk on line 18
Process exited with code 255.
Output for 5.3.21 - 5.6.28
Notice: Use of undefined constant x - assumed 'x' in /in/KgUbk on line 18 Fatal error: Call to undefined function getRank() in /in/KgUbk on line 18
Process exited with code 255.