3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Thesaurus { private $thesaurus; function Thesaurus($thesaurus) { $this->thesaurus = $thesaurus; } public function getSynonyms($word) { echo $thesaurus; echo $word; } } $thesaurus = new Thesaurus( array ( "buy" => array("purchase"), "big" => array("great", "large") )); echo $thesaurus->getSynonyms("big"); echo "\n"; //echo $thesaurus->getSynonyms("agelast");
based on YZSDZ
Output for 7.0.0 - 7.3.0rc3
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Thesaurus has a deprecated constructor in /in/62gAA on line 2 Notice: Undefined variable: thesaurus in /in/62gAA on line 13 big
Output for hhvm-3.22.0
Notice: Undefined variable: thesaurus in /in/62gAA on line -1 big
Output for 5.6.0 - 5.6.30, hhvm-3.18.5 - 3.21.3
Notice: Undefined variable: thesaurus in /in/62gAA on line 13 big