3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { public $success; private $id; public function pub($id) { $this->id = $id; $this->success = $this->test(); } private function test() { $getArg = $this->id; if ($getArg (is_numeric($getArg) || $getArg === 'test')) { return true; } return false; } } $a = new A(); $a->pub('1'); var_dump($a->success);
based on GXGVW
Output for 7.0.28 - 7.3.0rc3
Fatal error: Uncaught Error: Call to undefined function 1() in /in/Qldl6:17 Stack trace: #0 /in/Qldl6(11): A->test() #1 /in/Qldl6(26): A->pub('1') #2 {main} thrown in /in/Qldl6 on line 17
Process exited with code 255.
Output for 5.6.38
Fatal error: Call to undefined function 1() in /in/Qldl6 on line 17
Process exited with code 255.