3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class myModel { public static function all() { return 1; } } class myClass { public $models; public $results; public function __construct() { $this->models = new StdClass; $this->models->myModel = new myModel; $this->results = $this->models->myModel::all(); } } $result = (new myClass)->results; echo $result;
Output for 7.0.0 - 7.2.0
1
Output for 5.4.0 - 5.6.21
Parse error: syntax error, unexpected '::' (T_PAAMAYIM_NEKUDOTAYIM) in /in/1Ajjc on line 19
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in /in/1Ajjc on line 19
Process exited with code 255.