3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Greeting { private static $message; public static function greet() { echo self::$message; } public static function __init($message) { self::$message = $message; } } class GreetingFactory { public static function createGreeting($message) { Greeting::__init($message); return 'Greeting'; } } class GreetingFactoryManager { private static $greetingFactory; public static function getInstance() { if (self::$greetingFactory === null) self::$greetingFactory = 'GreetingFactory'; return self::$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.70.0070.00716.58
8.3.60.0000.01416.63
8.3.50.0150.00523.05
8.3.40.0040.01118.84
8.3.30.0070.00719.09
8.3.20.0080.00020.16
8.3.10.0030.00521.90
8.3.00.0060.00317.25
8.2.180.0070.01316.75
8.2.170.0140.00718.87
8.2.160.0080.00522.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0070.00726.16
8.2.120.0040.00421.16
8.2.110.0000.01122.08
8.2.100.0130.00019.51
8.2.90.0040.00419.09
8.2.80.0000.00817.97
8.2.70.0030.00517.47
8.2.60.0050.00517.93
8.2.50.0030.00618.07
8.2.40.0000.01118.16
8.2.30.0070.00018.13
8.2.20.0030.00617.63
8.2.10.0040.00417.95
8.2.00.0040.00417.56
8.1.280.0070.01425.92
8.1.270.0000.00723.96
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0040.00419.27
8.1.230.0080.00419.09
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0090.00017.35
8.1.190.0030.00617.22
8.1.180.0080.00018.10
8.1.170.0040.00418.55
8.1.160.0040.00421.96
8.1.150.0060.00318.88
8.1.140.0040.00417.42
8.1.130.0080.00017.41
8.1.120.0070.00017.45
8.1.110.0040.00417.43
8.1.100.0070.00017.37
8.1.90.0000.00717.43
8.1.80.0030.00517.34
8.1.70.0030.00317.29
8.1.60.0030.00617.66
8.1.50.0050.00317.42
8.1.40.0000.00717.55
8.1.30.0040.00417.58
8.1.20.0040.00417.63
8.1.10.0040.00417.60
8.1.00.0050.00317.42
8.0.300.0070.00018.77
8.0.290.0040.00416.75
8.0.280.0000.00818.52
8.0.270.0060.00317.25
8.0.260.0000.00616.86
8.0.250.0030.00316.91
8.0.240.0030.00617.01
8.0.230.0000.00716.79
8.0.220.0000.00716.89
8.0.210.0000.00716.83
8.0.200.0060.00016.89
8.0.190.0000.00816.97
8.0.180.0070.00016.89
8.0.170.0070.00016.91
8.0.160.0040.00416.91
8.0.150.0040.00416.89
8.0.140.0070.00316.73
8.0.130.0000.00513.25
8.0.120.0000.00716.80
8.0.110.0040.00416.73
8.0.100.0070.00016.68
8.0.90.0070.00016.86
8.0.80.0030.01816.89
8.0.70.0000.00716.84
8.0.60.0080.00016.79
8.0.50.0000.00716.66
8.0.30.0100.01216.96
8.0.20.0100.01117.42
8.0.10.0080.00017.04
8.0.00.0080.01016.86
7.4.330.0000.00515.01
7.4.320.0060.00016.61
7.4.300.0040.00416.62
7.4.290.0070.00016.54
7.4.280.0070.00016.61
7.4.270.0000.00716.45
7.4.260.0030.00316.40
7.4.250.0000.00816.41
7.4.240.0030.00316.51
7.4.230.0030.00316.40
7.4.220.0090.00616.52
7.4.210.0030.01116.64
7.4.200.0030.00316.66
7.4.160.0130.01016.59
7.4.150.0090.00917.40
7.4.140.0120.00517.86
7.4.130.0230.01316.61
7.4.120.0080.00916.50
7.4.110.0030.01416.62
7.4.100.0110.00716.63
7.4.90.0130.00316.55
7.4.80.0140.00619.39
7.4.70.0130.00716.53
7.4.60.0090.00816.44
7.4.50.0000.00516.30
7.4.40.0030.01316.44
7.4.30.0160.00016.48
7.4.00.0120.00415.22
7.3.330.0000.00613.24
7.3.320.0030.00313.39
7.3.310.0030.00316.41
7.3.300.0030.00316.39
7.3.290.0000.01316.45
7.3.280.0110.00916.39
7.3.270.0150.00417.40
7.3.260.0140.00416.63
7.3.250.0120.00816.41
7.3.240.0100.01316.44
7.3.230.0060.01016.39
7.3.210.0070.01016.57
7.3.200.0140.02919.39
7.3.190.0120.00916.36
7.3.180.0060.01416.36
7.3.170.0040.01416.48
7.3.160.0130.00316.36
7.3.10.0100.00316.50
7.3.00.0060.00916.79
7.2.330.0120.01216.82
7.2.320.0080.00816.66
7.2.310.0100.01316.77
7.2.300.0120.00416.58
7.2.290.0090.00916.82
7.2.130.0030.01216.64
7.2.120.0080.00616.70
7.2.110.0040.00816.84
7.2.100.0040.01416.88
7.2.90.0080.00817.16
7.2.80.0040.00716.72
7.2.70.0000.01417.04
7.2.60.0060.00916.84
7.2.50.0030.01116.62
7.2.40.0110.00417.02
7.2.30.0090.00616.97
7.2.20.0060.00916.91
7.2.10.0090.00616.78
7.2.00.0020.01118.31
7.1.250.0070.00715.79
7.1.100.0030.00617.99
7.1.70.0030.00617.25
7.1.60.0060.01919.40
7.1.50.0030.00916.97
7.1.00.0000.08022.48
7.0.200.0000.00916.76
7.0.140.0030.06722.09
7.0.60.0100.07019.93
7.0.50.0100.04317.89
7.0.40.0130.03720.10
7.0.30.0330.07320.21
7.0.20.0270.05020.20
7.0.10.0070.04020.09
7.0.00.0100.04020.07
5.6.280.0000.07720.93
5.6.210.0100.04720.55
5.6.200.0130.05018.25
5.6.190.0000.07020.49
5.6.180.0270.06720.61
5.6.170.1130.04720.55
5.6.160.0100.04320.52
5.6.150.0000.04718.17
5.6.140.0030.04018.18
5.6.130.0130.08318.18
5.6.120.0100.07021.04
5.6.110.0200.07321.04
5.6.100.0170.07321.12
5.6.90.0100.04320.98
5.6.80.0170.06720.39
5.5.350.0270.07020.36
5.5.340.0130.07318.01
5.5.330.0070.04020.40
5.5.320.0300.07020.34
5.5.310.0300.04020.32
5.5.300.0070.03717.93
5.5.290.0030.08318.02
5.5.280.0030.09020.90
5.5.270.0070.09320.97
5.5.260.0030.06020.80
5.5.250.0070.08020.67
5.5.240.0070.07720.17
5.4.450.1530.05019.39
5.4.440.0270.03719.52
5.4.430.0900.03719.63
5.4.420.0300.04019.30
5.4.410.0270.03719.33
5.4.400.0330.04719.25
5.4.390.0330.04719.03
5.4.380.0300.05718.63
5.4.370.0470.06718.75
5.4.360.0300.06018.73
5.4.350.0470.07018.50
5.4.340.0330.06718.48
5.4.320.0070.04412.51
5.4.310.0090.05012.51
5.4.300.0070.03512.51
5.4.290.0130.04112.50
5.4.280.0080.03712.40
5.4.270.0040.03812.40
5.4.260.0080.03812.40
5.4.250.0100.04512.40
5.4.240.0090.03712.40
5.4.230.0090.03512.39
5.4.220.0100.04212.39
5.4.210.0050.05312.39
5.4.200.0060.04112.39
5.4.190.0060.03612.39
5.4.180.0050.04912.39
5.4.170.0090.03412.40
5.4.160.0080.03412.39
5.4.150.0040.03812.39
5.4.140.0110.05112.07
5.4.130.0070.03612.06
5.4.120.0070.04212.02
5.4.110.0030.03712.01
5.4.100.0030.04412.02
5.4.90.0040.04012.02
5.4.80.0050.03812.01
5.4.70.0080.03212.01
5.4.60.0050.03412.02
5.4.50.0060.04112.02
5.4.40.0090.03712.00
5.4.30.0070.03412.00
5.4.20.0070.03412.00
5.4.10.0070.03612.00
5.4.00.0060.03411.49
5.3.290.0050.04212.80
5.3.280.0080.03512.71
5.3.270.0060.03912.72
5.3.260.0060.03912.71
5.3.250.0070.03612.72
5.3.240.0050.03812.72
5.3.230.0040.04512.71
5.3.220.0050.03812.68
5.3.210.0050.03912.68
5.3.200.0090.03312.68
5.3.190.0080.03612.68
5.3.180.0070.03512.67
5.3.170.0050.04412.67
5.3.160.0070.03712.67
5.3.150.0050.03812.68
5.3.140.0050.03712.66
5.3.130.0070.03812.66
5.3.120.0070.04512.66
5.3.110.0040.04012.66
5.3.100.0090.03812.13
5.3.90.0060.03712.11
5.3.80.0070.03512.10
5.3.70.0080.03412.10
5.3.60.0040.03812.08
5.3.50.0040.03712.03
5.3.40.0080.03412.03
5.3.30.0050.03611.99
5.3.20.0050.03811.78
5.3.10.0070.03411.73
5.3.00.0070.04011.72
5.2.170.0040.0319.23
5.2.160.0040.0309.23
5.2.150.0020.0329.23
5.2.140.0060.0289.23
5.2.130.0060.0329.19
5.2.120.0050.0289.19
5.2.110.0050.0289.19
5.2.100.0040.0299.19
5.2.90.0070.0289.19
5.2.80.0040.0309.18
5.2.70.0020.0329.18
5.2.60.0050.0299.14
5.2.50.0050.0309.10
5.2.40.0030.0319.09
5.2.30.0080.0289.05
5.2.20.0030.0309.04
5.2.10.0070.0368.95
5.2.00.0050.0308.82
5.1.60.0020.0268.10
5.1.50.0010.0288.10
5.1.40.0030.0258.08
5.1.30.0060.0258.43
5.1.20.0020.0288.45
5.1.10.0030.0278.17
5.1.00.0060.0238.17
5.0.50.0060.0186.65
5.0.40.0030.0206.52
5.0.30.0020.0326.32
5.0.20.0040.0196.29
5.0.10.0050.0186.27
5.0.00.0020.0326.27
4.4.90.0010.0174.78
4.4.80.0030.0154.75
4.4.70.0050.0164.76
4.4.60.0020.0174.75
4.4.50.0010.0224.77
4.4.40.0010.0264.71
4.4.30.0020.0164.76
4.4.20.0040.0144.84
4.4.10.0000.0184.85
4.4.00.0030.0244.76
4.3.110.0030.0154.67
4.3.100.0020.0154.66
4.3.90.0020.0154.64
4.3.80.0010.0254.58
4.3.70.0020.0164.63
4.3.60.0040.0134.62
4.3.50.0050.0134.63
4.3.40.0020.0254.54
4.3.30.0040.0183.30
4.3.20.0020.0173.28
4.3.10.0010.0173.24
4.3.00.0030.01315.91

preferences:
60.56 ms | 401 KiB | 5 Q