3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Str{ private static $test = 'tst'; static function quicksort($str,){ $rtnString = ""; //return $rtnString; return $this->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: Using $this when not in object context in /in/WI7RF:10 Stack trace: #0 /in/WI7RF(16): Str::quicksort('873694512') #1 {main} thrown in /in/WI7RF 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/WI7RF 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/WI7RF on line 5
Process exited with code 255.

preferences:
87.27 ms | 401 KiB | 87 Q