3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types=1); error_reporting(-1); ini_set('display_errors', 'On'); class BaseModel { protected static $singleton; public static function __getInstance(): self { if (static::$singleton === null) { static::$singleton = __CLASS__; static::$singleton = new static::$singleton(); } return static::$singleton; } } class AModel extends BaseModel { protected static $singleton; /** ... */ } class BModel extends BaseModel { protected static $singleton; /** ... */ } echo get_class(AModel::__getInstance()), "\n"; echo get_class(BModel::__getInstance());

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.5.30.0120.00517.23
8.5.20.0100.00819.52
8.5.10.0090.00919.07
8.5.00.0130.01121.84
8.4.180.0110.01021.80
8.4.170.0130.00823.92
8.4.160.0080.01423.91
8.4.150.0080.00416.87
8.4.140.0120.00917.73
8.4.130.0130.00717.61
8.4.120.0120.00620.55
8.4.110.0150.00518.94
8.4.100.0090.01117.86
8.4.90.0100.01020.76
8.4.80.0050.00320.50
8.4.70.0140.00719.03
8.4.60.0120.00820.53
8.4.50.0130.00720.59
8.4.40.0090.00017.69
8.4.30.0040.00420.48
8.4.20.0030.00517.88
8.4.10.0080.00019.63
8.3.300.0130.00722.82
8.3.290.0120.00919.95
8.3.280.0080.00416.18
8.3.270.0120.00716.50
8.3.260.0100.00916.48
8.3.250.0130.00518.73
8.3.240.0130.00616.78
8.3.230.0140.00616.70
8.3.220.0140.00418.88
8.3.210.0120.00816.69
8.3.200.0040.00516.51
8.3.190.0140.00317.39
8.3.180.0100.00820.84
8.3.170.0130.00617.04
8.3.160.0100.00716.64
8.3.150.0080.00016.58
8.3.140.0030.00518.85
8.3.130.0080.00016.91
8.3.120.0030.00618.79
8.3.110.0080.01220.94
8.3.100.0040.00824.06
8.3.90.0080.00026.77
8.3.80.0060.00316.50
8.3.70.0120.00616.58
8.3.60.0170.00316.88
8.3.50.0130.00623.61
8.3.40.0100.01418.84
8.3.30.0150.00618.71
8.3.20.0080.00020.88
8.3.10.0040.00423.48
8.3.00.0040.00421.88
8.2.300.0120.01017.99
8.2.290.0100.01017.16
8.2.280.0080.01119.87
8.2.270.0160.00316.44
8.2.260.0140.00417.22
8.2.250.0040.00416.62
8.2.240.0120.00617.20
8.2.230.0030.00622.58
8.2.220.0170.00737.54
8.2.210.0040.00426.77
8.2.200.0040.00416.63
8.2.190.0030.01416.88
8.2.180.0070.00718.29
8.2.170.0090.00618.86
8.2.160.0130.00322.96
8.2.150.0050.00325.66
8.2.140.0060.00324.66
8.2.130.0080.00026.16
8.2.120.0000.00826.16
8.2.110.0090.00020.35
8.2.100.0060.00617.80
8.2.90.0000.00718.03
8.2.80.0050.00317.97
8.2.70.0030.00517.75
8.2.60.0080.00017.50
8.2.50.0000.00818.05
8.2.40.0000.00819.91
8.2.30.0000.00819.41
8.2.20.0030.00618.07
8.2.10.0000.00719.26
8.2.00.0070.00019.18
8.1.340.0100.00918.15
8.1.330.0130.00716.03
8.1.320.0120.00723.99
8.1.310.0110.00716.80
8.1.300.0040.01416.14
8.1.290.0060.00318.88
8.1.280.0150.00625.92
8.1.270.0170.00022.18
8.1.260.0050.00326.35
8.1.250.0080.00028.09
8.1.240.0170.00322.04
8.1.230.0030.01021.04
8.1.220.0040.00417.74
8.1.210.0050.00518.91
8.1.200.0050.00317.65
8.1.190.0070.00317.35
8.1.180.0000.00818.10
8.1.170.0060.00617.62
8.1.160.0040.00418.83
8.1.150.0040.00418.88
8.1.140.0070.00020.72
8.1.130.0000.00720.31
8.1.120.0040.00417.37
8.1.110.0000.00717.36
8.1.100.0000.00817.39
8.1.90.0030.00317.23
8.1.80.0080.00017.46
8.1.70.0000.00717.43
8.1.60.0080.00017.50
8.1.50.0030.00617.55
8.1.40.0040.00417.57
8.1.30.0030.00517.70
8.1.20.0030.00617.70
8.1.10.0000.00817.63
8.1.00.0040.00417.38
8.0.300.0050.00220.13
8.0.290.0040.00416.75
8.0.280.0000.00818.50
8.0.270.0000.00718.00
8.0.260.0000.00619.96
8.0.250.0060.00016.86
8.0.240.0000.00816.92
8.0.230.0070.00016.91
8.0.220.0000.00716.73
8.0.210.0030.00316.83
8.0.200.0040.00416.87
8.0.190.0000.00716.94
8.0.180.0050.00316.76
8.0.170.0040.00416.82
8.0.160.0040.00416.85
8.0.150.0080.00016.83
8.0.140.0030.00616.68
8.0.130.0000.00513.23
8.0.120.0000.00816.78
8.0.110.0030.00516.81
8.0.100.0070.00016.88
8.0.90.0050.00316.68
8.0.80.0110.00616.87
8.0.70.0040.00416.88
8.0.60.0000.00716.67
8.0.50.0000.00716.82
8.0.30.0070.01017.09
8.0.20.0060.01216.79
8.0.10.0030.00616.80
8.0.00.0110.00617.02
7.4.330.0050.00016.72
7.4.320.0000.00616.49
7.4.300.0070.00316.61
7.4.290.0030.00316.42
7.4.280.0000.00716.36
7.4.270.0030.00316.61
7.4.260.0000.00513.24
7.4.250.0030.00316.59
7.4.240.0070.00016.55
7.4.230.0030.00316.51
7.4.220.0000.00716.42
7.4.210.0060.01016.61
7.4.200.0080.00016.37
7.4.130.0110.00716.52
7.4.120.0180.00316.55
7.4.110.0090.00916.52
7.4.100.0080.00816.70
7.4.90.0150.00616.64
7.4.80.0150.00619.39
7.4.70.0060.01016.63
7.4.60.0100.01016.48
7.4.50.0110.00316.36
7.4.40.0100.00516.58
7.4.20.0160.00616.25
7.4.10.0160.00016.19
7.4.00.0060.00916.35
7.3.330.0060.00316.34
7.3.320.0030.00313.27
7.3.310.0060.00016.25
7.3.300.0000.00716.14
7.3.290.0050.00916.27
7.3.260.0000.01716.28
7.3.230.0140.00716.38
7.3.210.0030.01316.27
7.3.200.0070.01016.22
7.3.190.0110.00516.16
7.3.180.0040.01416.33
7.3.170.0070.01316.16
7.3.160.0090.00916.25
7.3.140.0120.01216.34
7.3.130.0060.00916.27
7.3.120.0060.01116.00
7.3.110.0030.01416.18
7.3.100.0060.01516.45
7.3.90.0120.00816.35
7.3.80.0060.01216.20
7.3.70.0120.00616.14
7.3.60.0110.01116.34
7.3.50.0110.00616.40
7.3.40.0130.01216.34
7.3.30.0100.01016.46
7.3.20.0120.00616.54
7.3.10.0100.01016.20
7.3.00.0120.00616.32
7.2.330.0140.01116.56
7.2.320.0060.01016.39
7.2.310.0030.01316.87
7.2.300.0090.00916.74
7.2.290.0080.00816.80
7.2.270.0180.00016.74
7.2.260.0120.00616.50
7.2.250.0090.00916.58
7.2.240.0100.00716.51
7.2.230.0130.01016.45
7.2.220.0060.00916.59
7.2.210.0060.00916.27
7.2.200.0060.01716.53
7.2.190.0100.00716.51
7.2.180.0140.00616.42
7.2.170.0090.01216.71
7.2.160.0090.00916.72
7.2.150.0120.00616.74
7.2.140.0130.01316.69
7.2.130.0040.01416.48
7.2.120.0100.01316.62
7.2.110.0030.02016.55
7.2.100.0090.01716.64
7.2.90.0120.01216.56
7.2.80.0030.02016.57
7.2.70.0150.00916.65
7.2.60.0180.00816.60
7.2.50.0060.01816.47
7.2.40.0090.01216.59
7.2.30.0120.00616.70
7.2.20.0060.01216.53
7.2.10.0090.00916.44
7.2.00.0140.01016.53

preferences:
45.83 ms | 1458 KiB | 5 Q