3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test{ function showMess() { echo 'this is a test'; } } $t = test; // no memory allocated for class var_dump($t); // string test $t = new test; // don't need () for class w/o parameter for instatiation var_dump($t,$t->showMess); // need () to invoke method var_dump($t->showMess()); // can't var_dump a method; null var_dump('have a nice day'); // string

preferences:
44.89 ms | 402 KiB | 5 Q