3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Interview code review assignment class Greeter { private static $sStart; private static $sEnd; /** * Sets the greeter's sentence * @param string $sentenceStart * @param string $sentenceEnd */ public static function setSentence(string $sentenceStart, string $sentenceEnd) { self::$sStart = $sentenceStart; self::$sEnd = $sentenceEnd; } public static function greet($name) { print self::$sStart . $name . self::$sEnd; } } Greeter::setSentence("Hello ", "!\n"); Greeter::greet("John"); // Outputs: "Hello John!\n" Greeter::setSentence("Have a nice day, ", "...\n"); Greeter::greet("Peter"); // Outputs: "Have a nice day, Peter...\n"

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.70.0100.00718.30
8.3.60.0030.01216.48
8.3.50.0130.00516.73
8.3.40.0120.00318.87
8.3.30.0030.01218.79
8.3.20.0060.00322.16
8.3.10.0080.00021.71
8.3.00.0050.00317.78
8.2.180.0060.00916.88
8.2.170.0110.00422.96
8.2.160.0100.00320.39
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0000.00720.39
8.2.120.0070.00026.35
8.2.110.0030.00620.99
8.2.100.0040.00718.22
8.2.90.0040.00419.23
8.2.80.0050.00317.97
8.2.70.0060.00617.25
8.2.60.0000.00817.80
8.2.50.0040.00418.10
8.2.40.0080.00022.07
8.2.30.0040.00420.91
8.2.20.0000.00718.09
8.2.10.0000.00817.83
8.2.00.0030.00518.03
8.1.280.0070.01325.92
8.1.270.0050.00222.14
8.1.260.0070.00026.35
8.1.250.0030.00628.09
8.1.240.0030.00623.79
8.1.230.0080.00319.04
8.1.220.0000.00817.74
8.1.210.0050.00318.77
8.1.200.0030.00617.35
8.1.190.0040.00417.23
8.1.180.0080.00018.10
8.1.170.0050.00318.57
8.1.160.0040.00419.03
8.1.150.0000.00820.73
8.1.140.0060.00319.45
8.1.130.0030.00318.85
8.1.120.0000.00817.48
8.1.110.0060.00317.33
8.1.100.0070.00017.48
8.1.90.0000.00717.46
8.1.80.0000.00817.52
8.1.70.0030.00317.49
8.1.60.0040.00417.47
8.1.50.0050.00317.54
8.1.40.0040.00417.55
8.1.30.0000.00917.71
8.1.20.0030.00617.64
8.1.10.0040.00417.47
8.1.00.0000.00717.54
8.0.300.0040.00418.77
8.0.290.0040.00416.63
8.0.280.0040.00418.36
8.0.270.0040.00417.31
8.0.260.0070.00016.87
8.0.250.0000.00816.94
8.0.240.0040.00416.86
8.0.230.0060.00316.96
8.0.220.0040.00416.82
8.0.210.0040.00416.79
8.0.200.0070.00016.86
8.0.190.0000.00916.83
8.0.180.0000.00716.90
8.0.170.0070.00016.91
8.0.160.0060.00316.91
8.0.150.0030.00416.80
8.0.140.0000.00716.90
8.0.130.0000.00513.37
8.0.120.0000.00716.82
8.0.110.0030.00616.71
8.0.100.0080.00016.85
8.0.90.0030.00316.77
8.0.80.0040.01216.89
8.0.70.0000.00716.73
8.0.60.0030.00516.75
8.0.50.0040.00416.88
8.0.30.0070.01017.13
8.0.20.0070.01317.40
8.0.10.0000.00716.92
8.0.00.0060.01216.84
7.4.330.0000.00615.55
7.4.320.0000.00716.62
7.4.300.0060.00016.66
7.4.290.0070.00016.63
7.4.280.0070.00016.52
7.4.270.0030.00316.57
7.4.260.0030.00313.29
7.4.250.0040.00416.46
7.4.240.0030.00316.63
7.4.230.0070.00016.64
7.4.220.0100.00716.71
7.4.210.0090.00716.57
7.4.200.0000.00716.53
7.4.160.0120.00916.48
7.4.150.0080.01217.40
7.4.140.0140.00717.86
7.4.130.0070.01116.39
7.4.120.0080.01016.50
7.4.110.0040.01416.63
7.4.100.0130.01316.59
7.4.90.0100.01316.53
7.4.80.0220.00019.39
7.4.70.0100.00716.41
7.4.60.0120.00316.41
7.4.50.0040.01116.37
7.4.40.0140.00316.71
7.4.30.0090.00616.45
7.4.00.0000.01214.75
7.3.330.0030.00313.18
7.3.320.0020.00213.18
7.3.310.0030.00316.47
7.3.300.0000.00616.41
7.3.290.0030.00316.22
7.3.280.0100.00816.33
7.3.270.0060.00917.40
7.3.260.0070.01016.50
7.3.250.0120.00616.38
7.3.240.0150.00416.33
7.3.230.0120.00616.32
7.3.210.0110.01116.32
7.3.200.0090.01216.40
7.3.190.0030.01416.66
7.3.180.0060.01016.72
7.3.170.0060.00916.70
7.3.160.0060.01116.64
7.3.10.0060.00616.57
7.3.00.0000.01216.30
7.2.330.0100.01016.36
7.2.320.0100.00616.29
7.2.310.0070.01016.75
7.2.300.0190.00016.80
7.2.290.0030.02016.66
7.2.130.0150.00916.73
7.2.120.0110.01616.85
7.2.110.0170.00316.77
7.2.100.0140.00716.90
7.2.90.0170.00816.65
7.2.80.0180.00416.74
7.2.70.0130.00716.75
7.2.60.0070.01116.85
7.2.50.0120.00916.55
7.2.40.0090.01216.94
7.2.30.0130.01016.46
7.2.20.0130.01816.48
7.2.10.0210.00616.66
7.2.00.0120.00718.22
7.1.250.0120.00815.76
7.1.200.0040.00715.64
7.1.100.0090.00318.03
7.1.70.1200.01015.34
7.1.60.2770.01732.72
7.1.50.0230.01332.80
7.1.40.0170.01332.73
7.1.30.1570.01732.61
7.1.20.0300.01332.34
7.1.10.0500.01014.43
7.1.00.2570.01014.74
7.0.200.0100.00714.75
7.0.190.2170.02014.41
7.0.180.0100.00714.38
7.0.170.3530.00714.27
7.0.160.0000.01714.26
7.0.150.0800.01314.32
7.0.140.2730.01314.47
7.0.130.1770.01314.88
7.0.120.0170.01314.75
7.0.110.2030.01314.36
7.0.100.0170.01314.35
7.0.90.0130.01014.52
7.0.80.2070.01314.46
7.0.70.1100.01714.50
7.0.60.2070.01714.16
7.0.50.1930.01714.65
7.0.40.1830.01714.38
7.0.30.1630.01714.71
7.0.20.1970.00314.52
7.0.10.1970.01314.65
7.0.00.2000.01014.67

preferences:
57.68 ms | 401 KiB | 5 Q