3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php abstract class Vehicle { protected $name = 'YourMom'; public function getName(): string { return $this->name; } } class Truck extends Vehicle { protected $weight = 100; public function getWeight(): int { return $this->weight; } } #main wannabie :p { $truck = new Truck; if ($truck instanceof Vehicle) { echo '#idiot'; } else { echo '#youwin'; } #}
Output for 7.0.0 - 7.2.0
#idiot
Output for 5.3.22 - 5.6.28
Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/5s78p on line 5
Process exited with code 255.