3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Greeting { private static $message; public static function greet() { echo $this->message; } public static function __init($message) { $this->message = $message; } } class GreetingFactory { public static function createGreeting($message) { Greeting::__init($message); return 'Greeting'; } } class GreetingFactoryManager { private static $greetingFactory; public static function getInstance() { if (static::$greetingFactory === null) static::$greetingFactory = 'GreetingFactory'; return static::$greetingFactory; } } $greeterFactory = GreetingFactoryManager::getInstance(); $greeter = $greeterFactory::createGreeting('G\' morning'); $greeter::greet();

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.60.0090.00916.63
8.3.50.0120.00922.98
8.3.40.0120.00318.84
8.3.30.0030.01419.07
8.3.20.0000.00820.31
8.3.10.0000.00821.89
8.3.00.0030.00617.88
8.2.180.0090.00916.75
8.2.170.0070.00722.96
8.2.160.0090.00620.47
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0000.00726.16
8.2.120.0060.00321.09
8.2.110.0160.00320.99
8.2.100.0040.00718.09
8.2.90.0040.00419.06
8.2.80.0080.00017.97
8.2.70.0050.00317.75
8.2.60.0030.00817.80
8.2.50.0060.00318.07
8.2.40.0030.00718.22
8.2.30.0040.00418.05
8.2.20.0030.00617.57
8.2.10.0000.00818.07
8.2.00.0000.00817.76
8.1.280.0040.01125.92
8.1.270.0050.00323.96
8.1.260.0050.00326.35
8.1.250.0100.00328.09
8.1.240.0100.00722.47
8.1.230.0040.00719.48
8.1.220.0050.00317.74
8.1.210.0050.00318.77
8.1.200.0030.00617.35
8.1.190.0040.00417.13
8.1.180.0080.00018.10
8.1.170.0000.00918.59
8.1.160.0040.00421.97
8.1.150.0050.00318.74
8.1.140.0040.00417.38
8.1.130.0000.00717.75
8.1.120.0030.00517.39
8.1.110.0020.00517.43
8.1.100.0000.00717.30
8.1.90.0040.00417.45
8.1.80.0040.00417.34
8.1.70.0040.00417.36
8.1.60.0040.00417.51
8.1.50.0040.00417.44
8.1.40.0040.00417.54
8.1.30.0030.00617.65
8.1.20.0000.00717.71
8.1.10.0000.00717.57
8.1.00.0000.00817.42
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0080.00018.44
8.0.270.0050.00317.20
8.0.260.0040.00418.43
8.0.250.0030.00317.00
8.0.240.0070.00317.01
8.0.230.0000.00716.95
8.0.220.0030.00316.79
8.0.210.0070.00016.84
8.0.200.0040.00416.86
8.0.190.0050.00316.94
8.0.180.0000.00716.97
8.0.170.0080.00016.95
8.0.160.0050.00216.88
8.0.150.0000.00716.89
8.0.140.0090.00316.89
8.0.130.0050.00013.34
8.0.120.0000.00716.78
8.0.110.0020.00516.92
8.0.100.0040.00416.86
8.0.90.0040.00416.89
8.0.80.0060.01016.84
8.0.70.0040.00416.78
8.0.60.0000.00716.80
8.0.50.0000.00716.84
8.0.30.0120.00617.08
8.0.20.0190.01017.40
8.0.10.0050.00216.91
8.0.00.0110.00816.93
7.4.330.0050.00015.20
7.4.320.0040.00416.54
7.4.300.0060.00016.62
7.4.290.0000.00716.65
7.4.280.0060.00316.56
7.4.270.0030.00316.57
7.4.260.0070.00016.52
7.4.250.0040.00416.38
7.4.240.0030.00316.56
7.4.230.0000.00716.45
7.4.220.0100.00616.49
7.4.210.0030.01016.64
7.4.200.0000.00716.67
7.4.160.0070.01016.62
7.4.150.0080.01117.40
7.4.140.0090.00817.86
7.4.130.0110.00616.67
7.4.120.0120.00716.59
7.4.110.0070.01016.45
7.4.100.0120.00616.49
7.4.90.0130.00416.53
7.4.80.0120.00919.39
7.4.70.0070.01016.50
7.4.60.0070.01416.67
7.4.50.0050.00316.38
7.4.40.0090.00616.55
7.4.30.0140.00416.47
7.4.00.0000.01714.99
7.3.330.0050.00013.26
7.3.320.0030.00313.29
7.3.310.0000.00616.21
7.3.300.0070.00016.35
7.3.290.0110.00316.35
7.3.280.0080.00816.41
7.3.270.0150.00917.40
7.3.260.0060.01516.58
7.3.250.0110.00816.43
7.3.240.0150.00616.49
7.3.230.0170.00016.39
7.3.210.0150.00616.57
7.3.200.0140.00719.39
7.3.190.0060.01016.45
7.3.180.0160.00616.45
7.3.170.0150.00816.65
7.3.160.0070.01016.48
7.2.330.0040.01416.69
7.2.320.0030.01316.76
7.2.310.0110.00616.53
7.2.300.0090.00916.66
7.2.290.0160.00016.59
7.2.110.0090.00616.56
7.2.100.0000.01316.62
7.2.90.0060.00616.33
7.2.80.0060.00316.43
7.2.70.0030.01016.64
7.2.60.0040.00916.83
7.2.50.0060.00617.00
7.2.40.0060.00617.04
7.2.30.0160.00016.69
7.2.20.0130.00016.88
7.2.10.0060.00616.93
7.2.00.0100.00418.04
7.1.230.0040.00715.81
7.1.220.0040.00815.79
7.1.210.0060.00615.86
7.1.200.0090.00415.85
7.1.190.0030.01015.80
7.1.180.0030.00915.70
7.1.170.0130.00015.66
7.1.160.0090.00315.71
7.1.150.0080.00415.71
7.1.140.0060.00615.64
7.1.130.0030.00815.88
7.1.120.0030.01015.82
7.1.110.0140.00015.88
7.1.100.0080.00716.96
7.1.90.0030.00915.75
7.1.80.0100.00315.57
7.1.70.0060.00916.59
7.1.60.0090.01017.54
7.1.50.0090.01016.43
7.1.40.0070.01015.95
7.1.30.0130.00315.77
7.1.20.0090.00315.81
7.1.10.0060.00615.87
7.1.00.0030.04319.08
7.0.310.0070.00715.41
7.0.300.0070.00715.21
7.0.290.0090.00315.43
7.0.280.0100.00315.33
7.0.270.0030.01015.43
7.0.260.0030.00715.20
7.0.250.0060.00615.51
7.0.240.0060.00615.33
7.0.230.0040.00815.53
7.0.220.0080.00315.25
7.0.210.0000.01015.54
7.0.200.0020.00915.94
7.0.190.0030.00315.28
7.0.180.0030.00715.41
7.0.170.0070.00715.13
7.0.160.0060.00615.27
7.0.150.0000.01115.43
7.0.140.0020.04418.69
7.0.130.0070.00715.14
7.0.120.0030.00815.35
7.0.110.0030.00915.46
7.0.100.0000.01315.14
7.0.90.0090.00315.43
7.0.80.0090.00615.33
7.0.70.0030.00815.20
7.0.60.0050.04017.76
7.0.50.0100.03316.66
7.0.40.0020.05016.81
7.0.30.0170.04216.76
7.0.20.0160.02716.91
7.0.10.0000.02816.76
7.0.00.0070.02216.63
5.6.380.0000.01414.25
5.6.370.0040.00814.47
5.6.360.0080.00014.48
5.6.350.0070.00714.64
5.6.340.0060.00614.47
5.6.330.0030.00914.21
5.6.320.0000.00814.06
5.6.310.0030.00714.28
5.6.300.0070.00414.49
5.6.290.0040.00714.49
5.6.280.0060.03817.71
5.6.270.0000.00814.27
5.6.260.0060.00614.32
5.6.250.0030.01014.29
5.6.240.0060.00914.36
5.6.230.0030.01014.30
5.6.220.0000.01214.44
5.6.210.0020.02617.41
5.6.200.0060.02316.21
5.6.190.0060.02317.33
5.6.180.0180.03117.52
5.6.170.0140.03417.54
5.6.160.0060.02417.42
5.6.150.0000.03116.22
5.6.140.0140.03616.30
5.6.130.0050.02916.31
5.6.120.0050.02517.55
5.6.110.0080.04317.57
5.6.100.0050.04717.60
5.6.90.0080.04017.67
5.6.80.0080.03617.35
5.6.70.0070.00713.99
5.6.60.0030.01014.16
5.6.50.0050.00214.32
5.6.40.0000.01114.51
5.6.30.0090.00014.13
5.6.20.0040.01114.12
5.6.10.0060.00614.34
5.6.00.0030.00914.17
5.5.380.0030.00611.38
5.5.370.0100.00011.14
5.5.360.0080.00311.17
5.5.350.0150.03915.80
5.5.340.0070.04314.63
5.5.330.0050.03315.63
5.5.320.0150.04315.89
5.5.310.0180.04315.88
5.5.300.0050.02014.62
5.5.290.0040.02414.48
5.5.280.0120.04016.09
5.5.270.0110.03515.82
5.5.260.0030.02815.95
5.5.250.0090.03215.90
5.5.240.0060.03815.80
5.5.230.0040.00411.05
5.5.220.0040.00811.13
5.5.210.0000.01111.18
5.5.200.0000.00911.23
5.5.190.0060.00311.23
5.5.180.0000.01011.07
5.5.170.0090.00413.85
5.5.160.0110.00011.34
5.5.150.0000.01211.34
5.5.140.0080.00311.06
5.5.130.0060.00310.87
5.5.120.0060.00311.17
5.5.110.0000.01011.04
5.5.100.0000.00711.07
5.5.90.0000.01011.09
5.5.80.0060.00311.10
5.5.70.0000.01211.16
5.5.60.0030.00611.04
5.5.50.0080.00311.03
5.5.40.0100.00011.21
5.5.30.0080.00410.89
5.5.20.0040.00711.17
5.5.10.0030.00711.18
5.5.00.0060.00310.93
5.4.450.0070.02915.39
5.4.440.0180.02515.24
5.4.430.0090.02115.29
5.4.420.0210.02315.31
5.4.410.0150.02315.28
5.4.400.0220.02015.00
5.4.390.0030.02314.94
5.4.380.0170.03514.91
5.4.370.0170.03214.61
5.4.360.0200.03614.76
5.4.350.0220.03114.91
5.4.340.0290.03314.96
5.4.330.0030.00711.25
5.4.320.0070.01911.78
5.4.310.0050.02311.80
5.4.300.0060.02411.94
5.4.290.0070.01811.81
5.4.280.0060.02011.77
5.4.270.0060.02111.77
5.4.260.0060.02211.67
5.4.250.0050.02411.81
5.4.240.0060.02311.79
5.4.230.0040.03111.76
5.4.220.0040.02911.62
5.4.210.0040.02211.69
5.4.200.0060.02411.56
5.4.190.0080.02111.68
5.4.180.0080.02111.75
5.4.170.0050.02711.68
5.4.160.0070.02011.73
5.4.150.0040.02311.66
5.4.140.0060.01911.54
5.4.130.0040.02111.54
5.4.120.0030.02111.69
5.4.110.0070.01911.62
5.4.100.0040.02011.56
5.4.90.0050.01911.46
5.4.80.0040.02111.60
5.4.70.0020.02411.63
5.4.60.0050.01911.47
5.4.50.0080.01811.57
5.4.40.0100.02211.59
5.4.30.0030.02411.51
5.4.20.0040.02211.51
5.4.10.0070.01811.44
5.4.00.0090.01911.30
5.3.290.0090.02411.76
5.3.280.0080.02111.66
5.3.270.0060.02211.67
5.3.260.0050.02311.72
5.3.250.0070.02011.70
5.3.240.0030.02511.67
5.3.230.0060.02511.66
5.3.220.0090.02111.65
5.3.210.0090.02711.64
5.3.200.0040.02211.65
5.3.190.0050.02111.64
5.3.180.0060.01911.70
5.3.170.0040.02311.72
5.3.160.0040.02311.64
5.3.150.0040.02111.68
5.3.140.0040.02211.68
5.3.130.0020.02711.64
5.3.120.0050.02311.64
5.3.110.0050.02411.63
5.3.100.0060.02311.39
5.3.90.0050.02111.36
5.3.80.0060.01811.36
5.3.70.0060.02011.36
5.3.60.0050.02111.35
5.3.50.0050.02011.34
5.3.40.0070.01911.32
5.3.30.0050.01911.30
5.3.20.0040.01911.20
5.3.10.0030.02311.18
5.3.00.0070.01711.17
5.2.170.0010.0209.92
5.2.160.0050.0189.92
5.2.150.0030.0219.92
5.2.140.0070.0159.92
5.2.130.0020.0199.90
5.2.120.0050.0169.90
5.2.110.0050.0149.90
5.2.100.0030.0169.90
5.2.90.0050.0179.90
5.2.80.0040.0189.90
5.2.70.0050.0159.90
5.2.60.0050.0189.88
5.2.50.0040.0159.86
5.2.40.0050.0149.85
5.2.30.0020.0229.84
5.2.20.0040.0239.83
5.2.10.0030.0179.78
5.2.00.0040.0179.72
5.1.60.0030.0169.36
5.1.50.0060.0139.35
5.1.40.0040.0169.35
5.1.30.0040.0159.52
5.1.20.0020.0229.53
5.1.10.0050.0149.39
5.1.00.0020.0199.39
5.0.50.0030.0138.63
5.0.40.0040.0118.56
5.0.30.0050.0158.47
5.0.20.0050.0098.45
5.0.10.0020.0138.44
5.0.00.0050.0178.44
4.4.90.0020.0117.70
4.4.80.0040.0087.68
4.4.70.0020.0117.68
4.4.60.0020.0137.68
4.4.50.0020.0127.69
4.4.40.0030.0157.66
4.4.30.0020.0117.69
4.4.20.0040.0097.73
4.4.10.0030.0107.73
4.4.00.0010.0177.69
4.3.110.0020.0127.64
4.3.100.0030.0127.64
4.3.90.0010.0107.62
4.3.80.0040.0137.60
4.3.70.0020.0107.62
4.3.60.0010.0117.62
4.3.50.0020.0107.62
4.3.40.0010.0197.57
4.3.30.0050.0106.96
4.3.20.0030.0096.95
4.3.10.0010.0116.93
4.3.00.0050.00813.26

preferences:
49.61 ms | 401 KiB | 5 Q