3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Str{ static $test = 'tst'; public function quicksort($str,){ $rtnString = ""; //return $rtnString; return self::test; } } $string = "873694512"; $strObj = new Str(); echo($strObj->quicksort($string));
Output for 8.1.23 - 8.1.28, 8.2.10 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Uncaught Error: Undefined constant Str::test in /in/D23NO:10 Stack trace: #0 /in/D23NO(16): Str->quicksort('873694512') #1 {main} thrown in /in/D23NO on line 10
Process exited with code 255.
Output for 5.4.0 - 5.4.30
Parse error: syntax error, unexpected ')', expecting '&' or variable (T_VARIABLE) in /in/D23NO on line 5
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected ')', expecting '&' or T_VARIABLE in /in/D23NO on line 5
Process exited with code 255.

preferences:
75.55 ms | 401 KiB | 87 Q